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