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