n = 4**1014 + 2**1012 - 7 n = bin(n)[2:] print(n.count("1"))