while True:
    try:
        a = int(input())
        print(str(bin(a))[2:].count("1"))
    except:
        break