#将一个整数转化为二进制数
def fun1(x):
    ans =[]
    while x > 0:
        ans.append(x % 2)
        x = x // 2
    return ans

while True:
    try:
        x1 = int(input())
        n = 0
        x2 = fun1(x1)
        for word in x2:
            if word == 1:
                n = n + 1
        print(n)
    except:
        break