Raising Bacteria

题意翻译

# 题目描述 你是一个细菌爱好者。 你想在一个盒子里养一定数量x个细菌。 最初,该框是空的。 每天早上,您可以将任何数量的细菌放入盒子中。 每个晚上,盒子里的每一个细菌都会分裂成两个细菌。 你希望在某个时刻看到盒子里的细菌数量为x。 你最少需要放多少个细菌才能在某时刻看到刚好x个细菌? # 输入 唯一包含一个整数x(1≤x≤10^9)的行。 # 输出 唯一包含一个整数的行:答案。 # 说明 对于第一个样品,我们可以在第一天早上在盒子中添加一个细菌,在第三天早上,盒子中将有4个细菌。 现在我们在盒子里又放了一个,细菌总数变成5。 在这个过程中我们添加了2个细菌,所以答案是2。 对于第二个样本,我们可以在第一天早上放一个细菌,而在第四天早上,这个盒子里会有8个细菌。 所以答案是1 感谢@HNYLMS_MuQiuFeng 提供翻译

题目描述

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^{9} $ ).

输出格式


The only line containing one integer: the answer.

输入输出样例

输入样例 #1

5

输出样例 #1

2

输入样例 #2

8

输出样例 #2

1

说明

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