# 20240919
while True:
    try:
        n = int(input())
        print(bin(n)[2:].count('1'))
    except:
        break