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