Count Set Bits
Count the 1 bits of a number with remainder and division.
Input format
One line with an integer N (at least 0).
Output format
Print how many 1s appear in the binary form of N (use repeated remainder and division by 2).
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
7Expected output
3Example 2
Input
8Expected output
1