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