CodeSprintLA 2020 — Individual Competition

Start

2020-05-23 13:00 AKDT

CodeSprintLA 2020 — Individual Competition

End

2020-05-23 15:30 AKDT
The end is near!
Contest is over.
Not yet started.
Contest is starting in -430 days 22:00:26

Time elapsed

2:30:00

Time remaining

0:00:00

Problem A
Going Nuts

/problems/codesprintla20.goingnuts/file/statement/en/img-0001.jpg
Gray Squirrel. Photo by Connor Danylenko

Your crazy biology professor makes the outlandish claim that the number of walnuts each squirrel stores for the winter is always a power of two. If this holds true, any given squirrel on campus is able to only store $2^{i}$ nuts for any integer $i$. Given an integer $n$, find the minimum number of squirrels ($m$) needed on campus to store $n$ nuts.

Input

The only line of input contains the integer $n$ ($0 \le n \le 1\, 000\, 000$).

Output

Print an integer representing the minimum number of squirrels $m$.

Sample Input 1 Sample Output 1
5
2
Sample Input 2 Sample Output 2
128
1
Sample Input 3 Sample Output 3
500
6