while True:
    try:
        num=bin(int(input()))
        a=num.count("1")
        print(a)
    except:
        break