#思路:转2进制之后数个数即可
while True:
    try:
        a=int(input())
        b=bin(a)[2:]
        print(b.count("1"))
    except:
        break