Count Set Bits
How many 1-bits are in the binary representation of ? (Try n & (n-1), which clears the lowest set bit.)
Input
A single integer .
Output
The number of set bits.
Constraints
Sample 1
Input
13
Output
3
Sample 2
Input
0
Output
0
How many 1-bits are in the binary representation of ? (Try n & (n-1), which clears the lowest set bit.)
A single integer .
The number of set bits.
Input
13
Output
3
Input
0
Output
0