while True:
    try:
        n = int(input())
        m = bin(n)  #转换成二进制的形式
        k = m.count('1')
        print(k)
    except:
        break