You are a lover of bacteria. You want to raise some bacteria in a box. 

Initially, the box is empty. Each morning, you can put any number of bacteria into the box. And each night, every bacterium in the box will split into two bacteria. You hope to see exactly x bacteria in the box at some moment. 

What is the minimum number of bacteria you need to put into the box across those days?


-----Input-----

The only line containing one integer x (1 ≤ x ≤ 10^9).


-----Output-----

The only line containing one integer: the answer.


-----Examples-----
Input
5

Output
2

Input
8

Output
1



-----Note-----

For the first sample, we can add one bacterium in the box in the first day morning and at the third morning there will be 4 bacteria in the box. Now we put one more resulting 5 in the box. We added 2 bacteria in the process so the answer is 2.

For the second sample, we can put one in the first morning and in the 4-th morning there will be 8 in the box. So the answer is 1.

Difficulty: interview

Starter code:

Solutions:
n = int(input())
ans = 1

while n != 1:
    if  n % 2 == 1:
        ans += 1
        n -= 1
    else:
        n //= 2

print(ans)

x = int(input())
print(bin(x).count('1'))


n = int(input())
a = 0
while (n > 0):
    a += n % 2
    n //= 2
print(a)

x = int(input())

ans = 0
while x > 0:
    ans += x % 2
    x //= 2
print(ans)


n = int(input())
print(str(bin(n)).count('1'))

def f(n):
    if n == 0:
        return 0
    if n % 2 == 1:
        return f(n // 2) + 1
    else:
        return f(n // 2)
    
    
n = int(input())
print(f(n))

n = int(input())
c = 0
while n > 0:
	c += n % 2
	n //= 2

print(c)


n = int(input())
#a = [int(c) for c in input().split()]
count = 0

while n > 0:
    if n & 1 == 1:
        count += 1
    n = n >> 1
print(count)


import sys

lines = sys.stdin.read().split("\n")
# n, k = map(int, lines[0].split(" "))
# n = int(lines[0])
# nums = list(map(int, lines[1].split(" ")))

n = int(lines[0])
print(sum(map(int, bin(n)[2:])))


print(bin(int(input())).count('1'))

n = int(input())
s = bin(n)[2:]
print(sum(list(map(int, s))))

n = int(input())
ans = 0
while n > 0:
    ans += n%2
    n //= 2
print(ans)

print(bin(int(input())).count('1'))


a = int(input())
s = bin(a)
k = 0;
for i in range(len(s)):
	if (s[i] == '1'):
		k += 1
print(k)

print(str(bin(int(input()))).count('1'))

n = int(input())
s = bin(n)
ans=0
n = len(s)
for i in range(n-1,1,-1):
    if s[i] == '1':
        ans+=1
print(ans)

a = int(input())
ans = 0
while(a != 0):
	j = 0
	while(a % 2 == 0):
		j = 1
		a //= 2
	if (j == 0):
		ans += 1
		a -= 1
print(ans)

n = int(input())
ans = 0
while (n!=0):
    if n%2==1:
        n-=1
        ans +=1
    else:
        n//=2
print(ans)


a=int(input())
ans=0
while a != 0:
    c=a%2
    ans=ans+c
    a=a//2
print(ans)


def main():
    mode="filee"
    if mode=="file":f=open("test.txt","r")

    if mode=="file":n=int(f.readline())
    else:n=int(input())
    print(sum( (n>>shift)&1 for shift in range(128) ))


    if mode=="file":f.close()


def __starting_point():
    main()

__starting_point()

import math
withFile = 0

if(withFile == 1):
    fin     = open('input.txt', 'r')
    fout    = open('output.txt', 'w')

def getl():
    if(withFile == 0):
        return input()
    else:
        return fin.readline()
def printl(s):
    if(withFile == 0):
        print(s)
    else:
        fout.write(str(s))
def get_arr():
    x = getl().split(' ')
    if(x[-1] == ''):
        x = x[:-1]
    return list(map(int, x))

def f(x):
    if(x == 0):
        return 0
    d = 1
    while(d < x):
        d <<= 1
    if(d != x):
        d >>= 1
    return 1 + f(x - d)

x = get_arr()[0]

print(f(x))



if(withFile == 1):
    fin.close()
    fout.close()

n = int(input())
col = 0
while n > 0:
    q = 0
    while 2 ** (q + 1) <= n:
        q += 1
    n -= 2 ** q
    col += 1
print(col)
        


n = int(input())
print(str(bin(n)).count("1"))


#import sys
#sys.stdin = open("python/in", "r")
#from collections import defaultdict
#import numpy as np
#import array as rr
#arr = rr.array('q')

n = int(input())
#n, m = [int (i) for i in input().split(" ")]
ans = 0
while n > 0:
    if n%2 == 1:
        ans += 1
    n = n//2

print(ans)

a = int(input())
if a == 1:
	print(1)
else:
	ans = 1
	while a != 1:
		if a % 2:
			ans += 1
			a -= 1
		a /= 2
	print(ans)