Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/while-ikkilik-yozuvdagi-birlar

Ones in binary

Easy 1000 ms 64 MB 32%
Share

A positive integer $n$ is given. Determine how many digits $1$ its binary notation contains (for example, $13 = 1101_{2}$ — three ones).

Writing the number in binary and counting the ones

Input

One positive integer $n$.

Output

One integer — the number of ones.

Note

$1 \le n \le 10^{18}$

Examples

Input #1
13
Output #1
3
Input #2
64
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.