while True:
try:
n = int(input())
nb = bin(n)
print(str(nb).count('1'))
except:
break
while True:
try:
n = int(input())
nb = bin(n)
print(str(nb).count('1'))
except:
break