Count how many 1's in a binary number.
Implement the function below for a non-negative integer. Return the number of set bits, without converting the number to a binary string.
Function signature: def count_ones(n):
Input is an integer n; output is an integer count.
def count_ones(n):