#include #include #include #include #include #include #include #include #include #include #include #define uLL unsigned long long #define LL long long #define _LL __int64 using namespace std; const int maxn=1000; int A[maxn]; int main() { #ifndef ONLINE_JUDGE freopen("in.cpp","r",stdin); #endif // ONLINE_JUDGE int T; cin>>T; while(T--){ _LL n; memset(A,0,sizeof(A)); scanf("%I64d",&n); int cnt=0; int flag=1; while(n){ int a=n%2; if(a==1) { if(flag) { cnt++;flag=0;} } else flag=1; n/=2; } cout<