while True:
    try:
        num = int(input())
        a = bin(num) #十转二
        a = list(a)
        count = 0
        for i in a:
            if(i == '1'): #找1的个数
                count += 1
        print(count)
    except:
        break