heh
Diffstat (limited to 'x.py')
-rw-r--r--x.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/x.py b/x.py
index e355d5d..af83269 100644
--- a/x.py
+++ b/x.py
@@ -1 +1,15 @@
-print(sum(map(lambda line: len(line) - 1 - eval(f"len({line})"), open(0).readlines())))
+def sm(j):
+ match j:
+ case dict():
+ if "red" in j.values():
+ return 0
+ return sum(map(sm, j.values()))
+ case int():
+ return j
+ case list():
+ return sum(map(sm, j))
+ case str():
+ return 0
+
+
+print(sm(__import__("json").loads(input())))