scripts/ege/Апробация 10.03.2023/14.py
2023-05-05 00:45:01 +03:00

12 lines
208 B
Python

def to_3(n):
s = ""
while n:
s += str(n % 3)
n //= 3
return s[::-1]
r = 2 * 729**1021 - 2 * 243**1022 + 81**1023 - 2 * 27**1024 - 1025
s = to_3(r)
print(s.count("0"))