SDE Path

Count Set Bits

Easy

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
7
Expected output
3
Example 2
Input
8
Expected output
1