Believer

아직 제출이 없습니다시간 제한2초메모리 제한512 MB

문제

Do you believe in dragons? Imagine that one of them wakes you up at night and asks the following:

Let's consider sequences of positive integers a=a_1,a_2,,a_ka = \langle a\_1, a\_2, \ldots, a\_k \rangle.

Let f(a,x)f(a, x) be the number of occurrences of xx in aa. For example, f(1,4,1,1,1)=3f(\langle 1, 4, 1, 1 \rangle, 1) = 3.

Let c(y)c(y) be the number of ones in the binary expansion of yy. For example, c(13)=c(1101_2)=3c(13) = c(1101\_2) = 3.

Let b(a)=_iac(f(a,i))b(a) = \sum \limits\_{i \in a} c(f(a, i)). For example, b(1,4,1,1)=c(3)+c(1)=2+1=3b(\langle 1, 4, 1, 1 \rangle) = c(3) + c(1) = 2 + 1 = 3.

For the given value of nn, find the maximum value of b(a)b(a) over all sequences with _i=1ka_i=n\sum \limits\_{i=1}^{k} a\_i = n.

What would you answer?

입력

The first line of the input contains a single integer tt (1t1031 \le t \le 10^3) --- the number of test cases.

Each of the next tt lines contains a single integer nn (1n10181 \le n \le 10^{18}).

출력

For each test case in order of input, output a single integer --- the answer to the problem.

힌트

In the first example test case, one possible sequence with b(a)=3b(a) = 3 is a=1,4,1,1a = \langle 1, 4, 1, 1 \rangle.