while True:

try:
    n = int(input())
    m = bin(n).count('1')
    print(m)
    
    
except:
    break