Count Set Bits
Easyjavapythonccppjavascript
Given a non-negative integer N, count how many 1 bits are present in its binary representation.
Input Format
A single line containing the integer N.
Output Format
Print the number of set bits.
Example 1
Input
13
Output
3
Explanation: 13 in binary is 1101, which has three 1 bits.
- 0 <= N <= 1000000000000000000