def f(n): s = 0 while n > 0: if n % 2 == 1: s += 1 n //= 2 return s num = 4 ** 12 + 2 ** 32 - 16 print(f(num))