# 20240622
# 要增加异常处理的情况,否则会报错
while True:
    try:
        print(bin(int(input())).count('1'))
    except:# 处理异常
        break