Chef solved so many hard questions, now he wants to solve some easy problems for refreshment. Chef asks Cheffina for the new question. Cheffina challanges the chef to print the total number of 1's in the binary representation of N(natural number).

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- Each test case contains a single line of input, $N$. 

-----Output:-----
For each test case, output in a single line answer.

-----Constraints-----
- $1 \leq T \leq 10^6$
- $1 \leq N \leq 10^6$

-----Sample Input:-----
2
2
5

-----Sample Output:-----
1
2

-----EXPLANATION:-----
For 1) Binary representation of 2 is 10. i.e. only one 1 present in it.
For 2) Binary representation of 5 is 101, i.e. two 1's present in it.

Difficulty: interview

Starter code:

Solutions:
for t in range(int(input())):
    n=int(input())
    print(bin(n).count("1")) 

for i in range(int(input())):
    print(bin(int(input())).count("1")) 


for i in range(int(input())):
    print(bin(int(input())).count("1")) 


t=int(input())
for items in range(t):
    num=int(input())
    print(bin(num).count("1"))

def bin_one(temp: int):
    n = temp
    count = 0
    while n>0:
        if n%2 == 1:
            count += 1
        n = n // 2
    return count

t = int(input())
values = []
for _ in range(t):
    values.append(input())

for value in values:
    print(bin_one(int(value)))

import sys
# cook your dish here
T=int(input())
for t in range(T):
    N=int(sys.stdin.readline().strip())
    cnt=0
    while(N!=0):
        N= N&(N-1)
        cnt+=1
    print(cnt)


# def DecimaltoBinary():
#     N = int(input())
#     binary = bin(N)
#     setbits = [ones for ones in binary[2:] if ones=='1']
#     print(len(setbits))
        
        
# cook your dish here
t = int(input())
for i in range(t):
    N = int(input())
    print(bin(N).count("1")) 



# cook your dish here
def gcd(x, y):
    while y:
        x, y = y, x % y
    return x

def lcm(x, y):
    return (x*y)//(gcd(x,y))


abc="abcdefghijklmnopqrstuvwxyz"

pi=3.141592653589793238

t = int(input())
for _ in range(t):
    n = int(input())
    bin_n = bin(n)[2:]
    print(bin_n.count('1'))

for _ in range(int(input())):
    n=int(input())
    s=bin(n)
    s=s[2:]
    print(s.count('1'))

for _ in range(int(input())):
    print(bin(int(input())).count("1"))


# cook your dish here
for _ in range(int(input())):
    n=int(input())
    b=bin(n)
    print(b.count('1'))


cases = int(input())
for _ in range(cases):
    a = int(input())
    a = bin(a)
    c = a.count('1')
    print(c)

# cook your dish here
from collections import Counter
import string
import math
import sys
# sys.setrecursionlimit(10**6) 
def isprime(x): 
      
    # check for numbers from 2 
    # to sqrt(x) if it is divisible 
    # return false 
    i = 2
    while(i * i <= x): 
        if (x % i == 0): 
            return 0
        i+=1
    return 1
def isSumOfKprimes(N, K): 
      
    # N < 2K directly return false 
    if (N < 2 * K): 
        return 0
  
    # If K = 1 return value depends 
    # on primality of N 
    if (K == 1): 
        return isprime(N) 
  
    if (K == 2): 
          
        # if N is even directly 
        # return true; 
        if (N % 2 == 0): 
            return 1
  
        # If N is odd, then one  
        # prime must be 2. All  
        # other primes are odd 
        # and cannot have a pair 
        # sum as even. 
        return isprime(N - 2)
      
  
    # If K >= 3 return true; 
    return 1
from fractions import Fraction
def array_int():
    return [int(i) for i in sys.stdin.readline().split()]
def vary(arrber_of_variables):
    if arrber_of_variables==1:
        return int(sys.stdin.readline())
    if arrber_of_variables>=2:
        return list(map(int,sys.stdin.readline().split())) 
def makedict(var):
    return dict(Counter(var))
testcases=vary(1)

for _ in range(testcases):
    n=vary(1)
    print(bin(n)[2:].count('1'))
    
    


cases = int(input())
for _ in range(cases):
    a = int(input())
    a = bin(a)
    c = a.count('1')
    print(c)

for i in range(int(input())):
    n=int(input())
    z=bin(n)
    l=z.count('1')
    print(l)


# cook your dish here
import sys
#from sys import stdin,stdout
input=sys.stdin.readline
#sys.setrecursionlimit(10**7)
#import math
#import random
#import heapq
#from collections import Counter
#from queue import PriorityQueue
#from functools import lru_cache,cmp_to_key
#@lru_cache(maxsize=None) #for optimizing the execution time of callable objects/functions(placed above callable functions)

try:
    for _ in range(int(input())):
        n=int(input())
        ans=0
        while n:
            if n&1:
                ans+=1
            n=n//2
        print(ans)
        


        
except EOFError as e:
    print(e)


# cook your dish here
for i in range(int(input())):
    n=int(input())
    b=bin(n)
    print(b.count("1"))



# cook your dish here
try:
    for _ in range(int(input())):
        n=int(input())
        print(bin(n).count('1'))
except:pass        

# cook your dish here
try:
    for _ in range(int(input())):
        n=int(input())
        print(bin(n).count('1'))
except:pass        


for _ in range(int(input())):
    N = int(input())
    p = bin(N).count('1')
    print(p)

from sys import stdin, stdout, maxsize
from math import sqrt, log, factorial, gcd
from collections import defaultdict as D
from bisect import insort

for _ in range(int(input())):
    n = bin(int(input()))
    print(n.count("1"))
    




# cook your dish here
n=int(input())
for i in range(n):
    t=int(input())
    print(bin(t).count('1')) 


# cook your dish here
import math
from collections import defaultdict
for _ in range(int(input())):
    n = int(input())
    print(bin(n).count("1"))