while True:
    try:
        nlist=list(map(int,input().split()))
        for n in nlist:
            print(str(bin(n)).count('1'))
    except:
        break