while True:
    try:
        n = input()
        print(bin(int(n)).split("0b")[1].count("1"))
    except:break