Skip to content
UPEEC

Count Set Bits

Easy#bit-manipulation· solved by 0 · time limit 2.0 s

How many 1-bits are in the binary representation of nn? (Try n & (n-1), which clears the lowest set bit.)

Input

A single integer nn.

Output

The number of set bits.

Constraints

0≤n≤10180 \le n \le 10^{18}

Sample 1

Input

13

Output

3

Sample 2

Input

0

Output

0

Sign in or join free to run and submit your solution.