while True:
    try:
        n = int(input())
        b = format(n, "b")
        print(b.count("1"))
    except:
        break