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?
The only line containing one integer *x* (1 ≤ *x* ≤ 10<sup class="upper-index">9</sup>).
"""
A. Raising Bacteria: bitmasks

time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

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.
"""

def raising_bacteria():
    x = int(input())
    print(1 if x % 2 == 0 else x // 2)

if __name__ ==  '__main__':
    raising_bacteria()