#include #include #include #include #include #include #include #include #include #include #include using namespace std; unsigned long long n; int main(){ int T; cin>>T; while(T--){ cin>>n; int ans=0; if(n%2==1) ans++; int tep=n %2; n=n/2; while(n>0){ if(n%2==tep); else { if(n%2==1) ans++; tep=n%2; } n=n/2; } cout<