while True:
    try:
        num = int(input())
        cnt = 0
        while num != 0:
            if num % 2 == 1:
                cnt += 1
            num //= 2
        print(cnt)
    except:
        brea