LearnPy Hub
← Operators problems
Hard

Count the Ones

Read a non-negative integer and print how many 1s are in its binary form.

Input

One integer ≥ 0.

Output

A count.

Sample 1

Input
5
Output
2

Sample 2

Input
0
Output
0
solution.py
Output appears here
Count the Ones · Python practice problem · LearnPy Hub