#include<map>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<cstdlib>
#include<sstream>
#include<iostream>
#include<algorithm>
using namespace std;
#define lowbit(x) (x&(-x))
#define INF 99999999
#define LLINF 0x7fffffffffffffffll
#define LL __int64
#define MAXN 110000
#define MAXE 1100000
#define CH 129
#define eps 1e-8
#define PI acos(-1.0)
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define CC(m,what) memset(m,what,sizeof(m))
#define fuck puts("<<---------------------");
template<class Z>inline bool checkmax(Z &a,Z b){if(a==-1||a<b){a=b;return true;}return false;}
template<class Z>inline bool checkmin(Z &a,Z b){if(a==-1||a>b){a=b;return true;}return false;}

int n,m;
struct Road{
    int u,v,len;
    int idx;
    bool operator <(const Road &b)const{
        return len<b.len;
    }
}road[MAXE];
//--------------------------------------
int tree[MAXN];
int find(int x){
    if(x==tree[x]) return x;
    return tree[x]=find(tree[x]);
}
//--------------------------------------
int ans[MAXN];
int Dindex,Bcnt,Stop,idx;
int LOW[MAXN];
int DFN[MAXN];
int Belong[MAXN];
int stap[MAXN];
int instack[MAXN];
int isbridge[MAXN];
int net[MAXN],size;

struct EDGE{
     int v,next;
     int idx;
}edge[MAXE];

void init(){
    size=0;
    memset(net,-1,sizeof(net));
}

void add(int u,int v,int idx){
    edge[size].v=v;
    edge[size].idx=idx;
    edge[size].next=net[u];
    net[u]=size++;
}

void tarjan(int u,int fa){
    DFN[u]=LOW[u]=++Dindex;
    stap[++Stop]=u;
    int ff=1;
    for(int i=net[u];i!=-1;i=edge[i].next){
        int v=edge[i].v;
        if(v==fa&&ff) {
            ff=0;
            continue;
        }
        if(!DFN[v]){
            tarjan(v,u);
            if(LOW[v]<LOW[u]) LOW[u]=LOW[v];
            if(LOW[v]>DFN[u]){
                ans[edge[i].idx]=2;
            }
        }
        else if(DFN[v]<LOW[u]){
            LOW[u]=DFN[v];
        }
    }
}

void solve(){
    Dindex=Bcnt=Stop=0;
    memset(DFN,0,sizeof(DFN));
    for(int i=1;i<=n;i++){
        if(!DFN[i]) tarjan(i,-1);
    }
}
int main(){
    int i,j;
    while(scanf("%d%d",&n,&m)!=EOF){
        init();
        for(i=0;i<=n;i++) tree[i]=i;
        for(i=1;i<=m;i++){
            scanf("%d%d%d",&road[i].u,&road[i].v,&road[i].len);
            road[i].idx=i;
            ans[i]=0;
        }
        sort(road+1,road+1+m);
        for(i=1;i<=m;){
            for(j=i; j<=m && road[i].len==road[j].len; j++){
                int fa=find(road[j].u);
                int fb=find(road[j].v);
                if(fa!=fb){
                    ans[road[j].idx]++;
                    add(fa,fb,road[j].idx);
                    add(fb,fa,road[j].idx);
                }
            }
            for(j=i; j<=m && road[i].len==road[j].len; j++){
                int fa=find(road[j].u);
                int fb=find(road[j].v);
                if(fa!=fb){
                    tree[fa]=fb;
                }
            }
            i=j;
        }
        solve();
        for(i=1;i<=m;i++){
            if(ans[i]==0) puts("none");
            else if(ans[i]==1) puts("at least one");
            else puts("any");
        }
    }
    return 0;
}


#include<map>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<cstdlib>
#include<sstream>
#include<iostream>
#include<algorithm>
using namespace std;
#define lowbit(x) (x&(-x))
#define INF 99999999
#define LLINF 0x7fffffffffffffffll
#define LL __int64
#define MAXN 110000
#define MAXE 1100000
#define CH 129
#define eps 1e-8
#define PI acos(-1.0)
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define CC(m,what) memset(m,what,sizeof(m))
#define fuck puts("<<---------------------");
template<class Z>inline bool checkmax(Z &a,Z b){if(a==-1||a<b){a=b;return true;}return false;}
template<class Z>inline bool checkmin(Z &a,Z b){if(a==-1||a>b){a=b;return true;}return false;}

int n,m;
struct Road{
    int u,v,len;
    int idx;
    bool operator <(const Road &b)const{
        return len<b.len;
    }
}road[MAXE];
//--------------------------------------
int tree[MAXN];
int find(int x){
    if(x==tree[x]) return x;
    return tree[x]=find(tree[x]);
}
//--------------------------------------
int ans[MAXN];
int Dindex,Bcnt,Stop,idx;
int LOW[MAXN];
int DFN[MAXN];
int Belong[MAXN];
int stap[MAXN];
int instack[MAXN];
int isbridge[MAXN];
int net[MAXN],size;

struct EDGE{
     int v,next;
     int idx;
}edge[MAXE];

void init(){
    size=0;
    memset(net,-1,sizeof(net));
}

void add(int u,int v,int idx){
    edge[size].v=v;
    edge[size].idx=idx;
    edge[size].next=net[u];
    net[u]=size++;
}

void tarjan(int u,int fa){
    DFN[u]=LOW[u]=++Dindex;
    stap[++Stop]=u;
    int ff=1;
    for(int i=net[u];i!=-1;i=edge[i].next){
        int v=edge[i].v;
        if(v==fa&&ff) {
            ff=0;
            continue;
        }
        if(!DFN[v]){
            tarjan(v,u);
            if(LOW[v]<LOW[u]) LOW[u]=LOW[v];
            if(LOW[v]>DFN[u]){
                ans[edge[i].idx]=2;
            }
        }
        else if(DFN[v]<LOW[u]){
            LOW[u]=DFN[v];
        }
    }
}

void solve(){
    Dindex=Bcnt=Stop=0;
    memset(DFN,0,sizeof(DFN));
    for(int i=1;i<=n;i++){
        if(!DFN[i]) tarjan(i,-1);
    }
}
int main(){
    int i,j;
    while(scanf("%d%d",&n,&m)!=EOF){
        init();
        for(i=0;i<=n;i++) tree[i]=i;
        for(i=1;i<=m;i++){
            scanf("%d%d%d",&road[i].u,&road[i].v,&road[i].len);
            road[i].idx=i;
            ans[i]=0;
        }
        sort(road+1,road+1+m);
        for(i=1;i<=m;){
            init();
            for(j=i; j<=m && road[i].len==road[j].len; j++){
                int fa=find(road[j].u);
                int fb=find(road[j].v);
                if(fa!=fb){
                    ans[road[j].idx]++;
                    add(fa,fb,road[j].idx);
                    add(fb,fa,road[j].idx);
                }
            }
            int k=0;
            for(j=i; j<=m && road[i].len==road[j].len; j++){
                int fa=find(road[j].u);
                int fb=find(road[j].v);
                if(fa!=fb){
                    k++;
                    tree[fa]=fb;
                }
            }
            solve();
            //if((j-i)==k && ans[road[i].idx]==1){
            //    for(j=i; j<=m && road[i].len==road[j].len; j++){
            //        ans[road[j].idx]=2;
            //    }
            //}
            i=j;
        }
        //solve();
        for(i=1;i<=m;i++){
            if(ans[i]==0) puts("none");
            else if(ans[i]==1) puts("at least one");
            else puts("any");
        }
    }
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

#define fore(i,a,b) for(int i = a; i < (b); i++)
#define fr(i,a,b) for(int i = a - 1; i >= b; i--)
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define N 200005
#define inf INT32_MAX
#define MOD 1000000007

using namespace std;

typedef long long ll;
typedef pair<int,int> pr;
typedef pair<pair<int,int>, int> tup;

inline void solve()
{
	int q;
	cin >> q;
	while (q--) {
		int n;
		cin >> n;
		vector<ll> arr(n);
		map<ll, ll> mp;
		ll otv = 0;
		fore(i, 0, n)
		{
			cin >> arr[i];
			ll k = arr[i];
			if (arr[i] % 2 == 0)
			{
				ll h = 0;
				while (k % 2 == 0)
				{
					h++;
					k /= 2;
				}
				mp[k] = max(mp[k], h);
			}
		}

		for (auto x : mp)
		{
			otv += x.second;
		}

		cout << otv;
		cout << '\n';
	}
}

int main()
{
	fast;
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve();
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

#define fore(i,a,b) for(int i = a; i < (b); i++)
#define fr(i,a,b) for(int i = a - 1; i >= b; i--)
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define N 200005
#define inf INT32_MAX
#define MOD 1000000007

using namespace std;

typedef long long ll;
typedef pair<int,int> pr;
typedef pair<pair<int,int>, int> tup;

inline void solve()
{
	int q;
	cin >> q;
	while (q--) {
		int n;
		cin >> n;
		vector<ll> arr(n);
		map<ll, ll> mp;
		ll otv = 0;
		fore(i, 0, n)
		{
			cin >> arr[i];
			ll k = arr[i];
			if (mp[arr[i]] == 0)
				while (k % 2 == 0)
				{
					mp[arr[i]]++;
					k /= 2;
				}
		}

		for (auto x : mp)
		{
			fore(i, 1, 30)
			{
				if (mp[x.first * (1 << i)] != 0)
				{
					goto lab;
				}
			}
			otv += x.second;
		lab:
			continue;
		}

		cout << otv;
		cout << '\n';
	}
}

int main()
{
	fast;
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	solve();
}


#include <iostream>
#include <queue>
using namespace std;
int t,n,v,s,v1;
int main()
{cin>>t;
for(int i=0;i<t;i++){
        cin>>n;
        v=0;s=0;v1=0;
priority_queue  <int>  a;
for(int j=0;j<n;j++){
    cin>>v;
    if(v%2==0) a.push(v);
}
while(!a.empty()){
    v=a.top();
    a.pop();
    while((a.top()==v)and(!a.empty())){a.pop();}
    v/=2;
    s++;
    if((v%2==0)and(v!=0)) a.push(v);
}
cout<<s<<" ";
}
}


#include <iostream>
#include <queue>
using namespace std;
int t,n,v,s,v1;
int main()
{cin>>t;
for(int i=0;i<t;i++){
        cin>>n;
priority_queue  <int>  a;
for(int j=0;j<n;j++){
    cin>>v;
    if(v%2==0) a.push(v);
}
while(!a.empty()){
    v=a.top();
    a.pop();
    while((a.top()==v)and(!a.empty())){a.pop();}
    v/=2;
    s++;
    if((v%2==0)and(v!=0)) a.push(v);
}
cout<<s<<" ";
}
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<vector<int>, null_type,less<vector<int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
typedef long long lint;
#define all(a) a.begin(), a.end()
#define endl '\n'
#define pb push_back
lint n;
vector<lint> num(n);
vector<vector<lint>> nechet(n);
void getAns(){
    for (int i = 0; i < n; i++){
        nechet[i][0] = num[i] / (num[i] & (-num[i]));
        nechet[i][1] = i;
    }
    sort(all(nechet));
    lint ans = 0;
    //for (auto h: nechet) cout << h[0] << " ";
    //cout << endl;
    lint cur = log2(num[nechet[0][1]] & (-num[nechet[0][1]]));
    for (int i = 1; i < n; i++){
        if (nechet[i - 1][0] == nechet[i][0]){
                //cout << 1;
            cur = max(cur, (lint) log2(num[nechet[i][1]] & (-num[nechet[i][1]])));
        }
        else{
            //cout << 0;
            ans += cur;
            cur = log2(num[nechet[i][1]] & (-num[nechet[i][1]]));
        }
        //cout << num[nechet[i][1]] << " " << cur << endl;
    }
    ans += cur;
    cout << ans << endl;
}
int main(){
    lint t;
    cin >> t;
    for (int j = 0; j < t; j++){
    cin >> n;
    num.assign(n, 0);
    nechet.assign(n, vector<lint>(2, 0));
    for (int i = 0; i < n; i++) cin >> num[i];
    getAns();
    }
}


#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef tree<vector<int>, null_type,less<vector<int>>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
typedef long long lint;
#define all(a) a.begin(), a.end()
#define endl '\n'
#define pb push_back
lint n;
vector<lint> num(n);
vector<vector<lint>> nechet(n);
void getAns(){
    for (int i = 0; i < n; i++){
        nechet[i][0] = num[i] / (num[i] & (-num[i]));
        nechet[i][1] = i;
    }
    sort(all(nechet));
    lint ans = 0;
    //for (auto h: nechet) cout << h[0] << " ";
    //cout << endl;
    lint cur = log2(num[nechet[0][1]] & (-num[nechet[0][1]]));
    for (int i = 1; i < n; i++){
        if (nechet[i - 1][0] == nechet[i][0]){
            cur = max(log2(num[nechet[i - 1][1]] & (-num[nechet[i - 1][1]])), log2(num[nechet[i][1]] & (-num[nechet[i][1]])));
        }
        else{
            ans += cur;
            cur = log2(num[nechet[i][1]] & (-num[nechet[i][1]]));
        }
        //cout << cur
    }
    ans += cur;
    cout << ans << endl;
}
int main(){
    lint t;
    cin >> t;
    for (int j = 0; j < t; j++){
    cin >> n;
    num.assign(n, 0);
    nechet.assign(n, vector<lint>(2, 0));
    for (int i = 0; i < n; i++) cin >> num[i];
    getAns();
    }
}


#include <bits/stdc++.h>

using namespace std;
set <long long> s;
long long t,n,k,x;
int main()
{
    cin>>t;
    for(int i=0;i<t;i++)
    {
        cin>>n;
        k=0;
        s.erase(s.begin(),s.end());
        for(int j=0;j<n;j++)
        {
            cin>>x;
            if (x%2==0)
            s.insert(x);
        }
        while(s.size()>0)
        {
            k++;
            x=*(s.rbegin());
            s.erase(x);
            x=x/2;
            if(x%2==0)
               s.insert(x);
         }
        cout<<k<<endl;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <math.h>
#include <climits>
#include <set>

//#include <chrono>
//#include <fstream>
//#include <bits/stdc++.h>

#define mp make_pair
#define pb push_back
#define eb emplace_back
#define x first
#define y second
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b) - 1; i >= (a); i--)

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> veci;
typedef vector<bool> vecb;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;

const int INF_I = 1e9;
const ll INF_LL = 1e18;

int main() {
	/*ifstream cin("in.txt");
	ofstream cout("out.txt");
	auto start_time = chrono::high_resolution_clock::now();*/

	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;
		set<int> s;
		FOR(i, 0, n) {
			int a;
			cin >> a;
			s.emplace(-a);
		}
		int cnt = 0;
		for (int i : s) {
			if (i % 2 == 0) {
				s.emplace(i / 2);
				cnt++;
			}

		}
		cout << cnt << "\n";
	}

	/*auto end_time = chrono::high_resolution_clock::now();
	chrono::duration<double> duration = end_time - start_time;
	cout << duration.count() << "\n";
	cin.close();
	cout.close();*/
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while(t--){
        int  n;
        cin >> n;
        vector<pair<int, int> > vec;
        for(int i = 0; i < n; i++){
            int a;
            cin >> a;
            vec.push_back({a, i});
        }
        int ans = 0;
        vector<int> countt(n, 0);
        for(int i = 0; i < n; i++){
            int cnt = 0;
            while(vec[i].first % 2 == 0){
                vec[i].first /= 2;
                cnt++;
            }
            countt[i] = cnt;
        }
        sort(vec.begin(), vec.end());
        int j = 0;
        int pr = countt[vec[0].second];
        if(n == 1){
            cout << countt[0] << '\n';
            continue;
        }
        while(j != n - 1){
            if(vec[j].first == vec[j + 1].first && countt[vec[j + 1].second] > pr){
                pr = countt[vec[j + 1].second];
                if(j == n - 2){
                    ans+= pr;
                }
            }
            else if(vec[j].first != vec[j + 1].first){
                ans += pr;
                pr = countt[vec[j + 1].second];
            }
            else if(j == n - 2){
                ans += pr;
            }
            j++;
        }
    cout << ans << '\n';
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while(t--){
        int  n;
        cin >> n;
        vector<pair<int, int> > vec;
        for(int i = 0; i < n; i++){
            int a;
            cin >> a;
            vec.push_back({a, i});
        }
        int ans = 0;
        vector<int> countt(n, 0);
        for(int i = 0; i < n; i++){
            int cnt = 0;
            while(vec[i].first % 2 == 0){
                vec[i].first /= 2;
                cnt++;
            }
            countt[i] = cnt;
        }
        sort(vec.begin(), vec.end());
        int j = 0;
        int pr = countt[vec[0].second];
        if(n == 1){
            cout << countt[0] << '\n';
            continue;
        }
        while(j != n - 1){
            if(vec[j].first == vec[j + 1].first && countt[vec[j + 1].second] > pr){
                pr = countt[vec[j + 1].second];
                if(j == n - 2){
                    ans+= pr;
                }
            }
            else if(vec[j].first != vec[j + 1].first){
                ans += pr;
                pr = countt[vec[j + 1].second];
                if(j == n - 2){
                    ans += pr;
                }
            }
            else if(j == n - 2){
                ans += pr;
            }
            j++;
        }
    cout << ans << '\n';
    }
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define pf push_front
#define pof pop_front
#define pob pop_back
#define s second
#define f first
#define mp make_pair
#define lb lower_bound
#define in insert
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0)
#define pi 3.1415926535

using namespace std;

ll a, b, n, m, k, c, d[200200], mx;
ll ans;
string s, s1, s2;
vector <int> v;
//pair <int, int> p[300];
//map <int, bool> ma;
set <int> st;
char cc, cc2;
//int was[10000000];

bool ch, ch2, ch3, ch4;
pair <int, int> qq[200200];
const int N = (int)2e5 + 123, inf = 1e9, mod = 1e9 + 7;
const ll INF = 1e18;
bool was[(int)2e5+5];
bool was2[(int)2e5+50];
int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
     	cin >> k;
    	for(int j = 1; j <= k; j++){
    	 	cin >> d[i];
    	 	while(1){
    	 	 	if(d[i] & 1){
    	 	 	 	break;
    	 	 	}
    	 	 	d[i] /= 2;
    	 	 	st.in(d[i]);
    	 	}
     	}
     	cout << st.size() << '\n';
     	st.clear();
    }
    return 0;
}


#include <bits/stdc++.h>

#define ll long long
#define pb push_back
#define pf push_front
#define pof pop_front
#define pob pop_back
#define s second
#define f first
#define mp make_pair
#define lb lower_bound
#define in insert
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0)
#define pi 3.1415926535

using namespace std;

ll a, b, n, m, k, c, d[200200], mx;
ll ans;
string s, s1, s2;
vector <int> v;
//pair <int, int> p[300];
//map <int, bool> ma;
multiset <int> st;
char cc, cc2;
//int was[10000000];

bool ch, ch2, ch3, ch4;
pair <int, int> qq[200200];
const int N = (int)2e5 + 123, inf = 1e9, mod = 1e9 + 7;
const ll INF = 1e18;
bool was[(int)2e5+5];
bool was2[(int)2e5+50];
int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
     	cin >> k;
    	for(int j = 1; j <= k; j++){
    	 	cin >> d[i];
    	 	while(1){
    	 	 	if(d[i] & 1){
    	 	 	 	break;
    	 	 	}
    	 	 	d[i] /= 2;
    	 	 	if(was[d[i]]){
    	 	 	 	break;
    	 	 	}
    	 	 	else{
    	 	 	 	was[d[i]] = 1;
    	 	 	 	v.pb(d[i]);
    	 	 	 	ans++;
    	 	 	}
    	 	}
     	}
     	cout << ans << '\n';
     	ans = 0;
     	for(int j = 0; j < v.size(); j++){
     	 	was[v[j]] = 0;
     	}
     	v.clear();
    }
    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>

#define ll long long

using namespace std;

int main()
{
    int t, n;
    ll int ans;
    //vector <pair<ll int, ll int>> a; // �������� ������� � ������� ������
    map <ll int, ll int> cnt; // ������� ����� � ����� ��������
    map <ll int, ll int> maxPower;
    map <ll int, ll int> minPower;

    map<ll int, ll int>::iterator it, itMaxP, itMinP;

    ll int b, k;

    cin >> t;

    for (int i = 0; i < t; i++) {
        cin >> n;
        ans = 0;

        for (int j = 0; j < n; j++) {
            cin >> b;

            k = 0;

            while (b > 0 && b % 2 == 0) {
                b /= 2;
                k++;
            }

            it = cnt.find(b);

            if (it == cnt.end()) {
                cnt[b] = k;
                maxPower[b] = k;
                minPower[b] = k;
            } else {
                cnt[b]++;
                maxPower[b] = max(maxPower[b], k);
                minPower[b] = min(minPower[b], k);
            }
        }

        for (it = cnt.begin(),
             itMaxP = maxPower.begin(),
             itMinP = minPower.begin();
             it != cnt.end();
             it++, itMaxP++, itMinP++) {

            if (itMaxP->second != 0) {
                ans += itMaxP->second - itMinP->second + 1;
            }
        }

        cout << ans << ' ';

        cnt.clear();
        maxPower.clear();
        minPower.clear();
    }

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>

#define ll long long

using namespace std;

int main()
{
    int t, n;
    ll int ans;
    //vector <pair<ll int, ll int>> a; // �������� ������� � ������� ������
    map <ll int, ll int> cnt; // ������� ����� � ����� ��������
    map <ll int, ll int> maxPower;
    map <ll int, ll int> minPower;

    map<ll int, ll int>::iterator it, itMaxP, itMinP;

    ll int b, k;

    cin >> t;

    for (int i = 0; i < t; i++) {
        cin >> n;
        ans = 0;

        for (int j = 0; j < n; j++) {
            cin >> b;

            k = 0;

            while (b > 0 && b % 2 == 0) {
                b /= 2;
                k++;
            }

            it = cnt.find(b);

            if (it == cnt.end()) {
                cnt[b] = k;
                maxPower[b] = k;
                minPower[b] = k;
            } else {
                cnt[b]++;
                maxPower[b] = max(maxPower[b], k);
                minPower[b] = min(minPower[b], k);
            }
        }

        for (it = cnt.begin(),
             itMaxP = maxPower.begin(),
             itMinP = minPower.begin();
             it != cnt.end();
             it++, itMaxP++, itMinP++) {

            if (itMaxP->second != 0) {
                if (it->first == 0) {
                    ans += itMaxP->second;

                } else if (itMaxP->second != itMinP->second) {
                    ans += itMaxP->second - itMinP->second + 1;
                } else {
                    ans += itMaxP->second;
                }
            }
        }

        cout << ans << ' ';
        //cout << endl << endl << ans << endl << endl;

        cnt.clear();
        maxPower.clear();
        minPower.clear();
    }

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>

#define ll long long

using namespace std;

int main()
{
    int t, n;
    ll int ans;
    //vector <pair<ll int, ll int>> a; // �������� ������� � ������� ������
    map <ll int, ll int> cnt; // ������� ����� � ����� ��������
    map <ll int, ll int> maxPower;
    //map <ll int, ll int> minPower;

    map<ll int, ll int>::iterator it, itMaxP;

    ll int b, k;

    cin >> t;

    for (int i = 0; i < t; i++) {
        cin >> n;
        ans = 0;

        for (int j = 0; j < n; j++) {
            cin >> b;

            k = 0;

            while (b > 0 && b % 2 == 0) {
                b /= 2;
                k++;
            }

            it = cnt.find(b);

            if (it == cnt.end()) {
                cnt[b] = k;
                maxPower[b] = k;
                //minPower[b] = k;
            } else {
                cnt[b]++;
                maxPower[b] = max(maxPower[b], k);
                //minPower[b] = min(minPower[b], k);
            }
        }

        for (it = cnt.begin(),
             itMaxP = maxPower.begin();
             it != cnt.end();
             it++, itMaxP++) {

            if (itMaxP->second != 0) {
                ans += itMaxP->second;
            }
        }

        cout << ans << ' ';
        //cout << endl << endl << ans << endl << endl;

        cnt.clear();
        maxPower.clear();
        //minPower.clear();
    }

    return 0;
}


#include <iostream>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>

#define ll long long

using namespace std;

int main()
{
    int t, n;
    ll int ans;
    //vector <pair<ll int, ll int>> a; // �������� ������� � ������� ������
    map <ll int, ll int> cnt; // ������� ����� � ����� ��������
    map <ll int, ll int> maxPower;
    map <ll int, ll int> minPower;

    map<ll int, ll int>::iterator it, itMaxP, itMinP;

    ll int b, k;

    cin >> t;

    for (int i = 0; i < t; i++) {
        cin >> n;
        ans = 0;

        for (int j = 0; j < n; j++) {
            cin >> b;

            k = 0;

            while (b > 0 && b % 2 == 0) {
                b /= 2;
                k++;
            }

            it = cnt.find(b);

            if (it == cnt.end()) {
                cnt[b] = k;
                maxPower[b] = k;
                minPower[b] = k;
            } else {
                cnt[b]++;
                maxPower[b] = max(maxPower[b], k);
                minPower[b] = min(minPower[b], k);
            }
        }

        for (it = cnt.begin(),
             itMaxP = maxPower.begin(),
             itMinP = minPower.begin();
             it != cnt.end();
             it++, itMaxP++, itMinP++) {

            if (itMaxP->second != 0) {
                ans += itMaxP->second - itMinP->second + 1;
            }
        }

        cout << endl << endl << ans << endl << endl;

        cnt.clear();
        maxPower.clear();
        minPower.clear();
    }

    return 0;
}


#include<bits/stdc++.h>

#define int long long
#define pb push_back
#define _ << ' ' <<
#define end << "\n"

const int mod = 1e9 + 7;
typedef long long ll;
typedef long double ld;

using namespace std;

void solve(){
    int n;
    cin >> n;
    int q;
    map<int, int> a;
    int val = 0;
    for(int i = 0; i < n; ++i){
        cin >> q;
        val = 0;
        while(q % 2 == 0){
            val ++;
            q /= 2;
        }
        a[q] = max(a[q], val);
    }
    int ans = 0;
    for(auto x: a){
        ans += x.second;
    }
    cout << ans << '\n';
}
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t--){
        solve();
    }
}


#include<bits/stdc++.h>

#define int long long
#define pb push_back
#define _ << ' ' <<
#define end << "\n"

const int mod = 1e9 + 7;
typedef long long ll;
typedef long double ld;

using namespace std;

void solve(){
    int n;
    cin >> n;
    set<int> a;
    int q;
    for(int i = 0; i < n; ++i){
        cin >> q;
        a.insert(-q);
    }
    /*for(auto x: a){
        cout << x << ' ';
    }*/
    bool f = false;
    int ans = 0;
    while(!f){
        f = 1;
        for(auto &x: a){
            if((-x) % 2 == 0){
                f = 0;
                a.erase(x);
                a.insert(-((-x) / 2));
                ans++;
                break;
            }
            //cout << x << "\n";
        }
    }
    cout << ans << '\n';
}
signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t = 1;
    cin >> t;
    while(t--){
        solve();
    }
}


#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define ld long double
#define pii pair <int,int>
#define pll pair <ll,ll>
#define pil pair <int,ll>
#define pli pair <ll,int>
#define ull unsigned long long
#define pdd pair <double,double>
#define pb push_back
#define mp make_pair
#define puu pair<ull,ull>
#define pvv pair<vector<int>, vector<int> >
#define _bp __builtin_popcount
#define ptt pair <Tree*,Tree*>
#define all(v) v.begin(),v.end()
const long double pi = acos(-1);
void boos()
{
     ios_base :: sync_with_stdio(false);
     cin.tie(0);
     cout.tie(0);
}
void file()
{
   freopen(".in","r",stdin);
   freopen(".out","w",stdout);
}
const ll INF = 1e9 + 7;
const ll INF1 = 998244353;
const ll LLINF = (ll)1e18;
const int  INTmx = (int)1e9;
const int N = 3e5 + 100;
int a[N];
map <int,int> was;
map <int,int> was1;
int main()
{
    //file();
    boos();
    int t;
    cin >> t;
    while(t--)
    {
        int n;
        cin >> n;
        for(int i = 1;i <= n;i++)
        {
            cin >> a[i];
            was[a[i]] = 1;
        }
        sort(a + 1,a + n + 1);
        ll ans = 0;
        for(int i = n;i >= 1;i--)
        {
            if(a[i] % 2 == 0)
            {
                if(!was1[a[i]])
                {
                    ans++;
                    was1[a[i]] = 1;
                    a[i] /= 2;
                    while(a[i] % 2 == 0 && !was[a[i]])
                    {
                        a[i] /= 2;
                        ans++;
                    }
                   // cout << ans << " ";
                }
            }
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define ld long double
#define pii pair <int,int>
#define pll pair <ll,ll>
#define pil pair <int,ll>
#define pli pair <ll,int>
#define ull unsigned long long
#define pdd pair <double,double>
#define pb push_back
#define mp make_pair
#define puu pair<ull,ull>
#define pvv pair<vector<int>, vector<int> >
#define _bp __builtin_popcount
#define ptt pair <Tree*,Tree*>
#define all(v) v.begin(),v.end()
const long double pi = acos(-1);
void boos()
{
     ios_base :: sync_with_stdio(false);
     cin.tie(0);
     cout.tie(0);
}
void file()
{
   freopen(".in","r",stdin);
   freopen(".out","w",stdout);
}
const ll INF = 1e9 + 7;
const ll INF1 = 998244353;
const ll LLINF = (ll)1e18;
const int  INTmx = (int)1e9;
const int N = 3e5 + 100;
int a[N];
int b[N];
map <int,int> was;
map <int,int> was1;
int main()
{
    //file();
    boos();
    int t;
    cin >> t;
    while(t--)
    {
        int n;
        cin >> n;
        for(int i = 1;i <= n;i++)
        {
            cin >> a[i];
            b[i] = a[i];
            was[a[i]] = 1;
        }
        sort(a + 1,a + n + 1);
        ll ans = 0;
        for(int i = n;i >= 1;i--)
        {
            if(a[i] % 2 == 0)
            {
                if(!was1[a[i]])
                {
                    ans++;
                    was1[a[i]] = 1;
                    a[i] /= 2;
                    while(a[i] % 2 == 0 && !was[a[i]])
                    {
                        a[i] /= 2;
                        ans++;
                    }
                   // cout << ans << " ";
                }
            }
        }
        for(int i = 1;i <= n;i++)
        {
            was[a[i]] = 0;
            was1[a[i]] = 0;
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define f first
#define s second
#define ll long long
#define ld long double
#define pii pair <int,int>
#define pll pair <ll,ll>
#define pil pair <int,ll>
#define pli pair <ll,int>
#define ull unsigned long long
#define pdd pair <double,double>
#define pb push_back
#define mp make_pair
#define puu pair<ull,ull>
#define pvv pair<vector<int>, vector<int> >
#define _bp __builtin_popcount
#define ptt pair <Tree*,Tree*>
#define all(v) v.begin(),v.end()
const long double pi = acos(-1);
void boos()
{
     ios_base :: sync_with_stdio(false);
     cin.tie(0);
     cout.tie(0);
}
void file()
{
   freopen(".in","r",stdin);
   freopen(".out","w",stdout);
}
const ll INF = 1e9 + 7;
const ll INF1 = 998244353;
const ll LLINF = (ll)1e18;
const int  INTmx = (int)1e9;
const int N = 3e5 + 100;
int a[N];
int b[N];
map <int,int> was;
map <int,int> was1;
int main()
{
    //file();
    boos();
    int t;
    cin >> t;
    while(t--)
    {
        int n;
        cin >> n;
        for(int i = 1;i <= n;i++)
        {
            cin >> a[i];
            b[i] = a[i];
            was[a[i]] = 1;
        }
        sort(a + 1,a + n + 1);
        ll ans = 0;
        for(int i = n;i >= 1;i--)
        {
            if(a[i] % 2 == 0)
            {
                if(!was1[a[i]])
                {
                    ans++;
                    was1[a[i]] = 1;
                    a[i] /= 2;
                    while(a[i] % 2 == 0 && !was[a[i]])
                    {
                        a[i] /= 2;
                        ans++;
                    }
                   // cout << ans << " ";
                }
            }
        }
        for(int i = 1;i <= n;i++)
        {
            was[b[i]] = 0;
            was1[b[i]] = 0;
        }
        cout << ans << endl;
    }
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>

using namespace std;

int main()
{
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        int n;
        cin >> n;
        long long ans = 0;
        set<pair<long long, bool>> s;
        for (int j = 0; j < n; ++j)
        {
            long long x;
            cin >> x;
            s.insert({x, true});
        }
        while (!s.empty())
        {
            long long x = s.rbegin() -> first;
            s.erase({x, true});
            if (x % 2 == 0)
            {
                x /= 2;
                s.insert({x, true});
                ans++;
            }
        }
        cout << ans << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long a;
    cin>>a;
    for(int e=0;e<a;e++){
        long long n;
        vector <pair<long long,long long> > sd(200000);
        cin>>n;
        long long f=0;
        int d;
        int s;
        for(int i=0;i<n;i++){
            cin>>s;
            d=0;
            if(s%2==0){
                while(s%2!=1){
                    s/=2;
                    d++;
                }
            }
            sd[i].first=s;
            sd[i].second=d;
        }
        sort(sd.begin(),sd.begin()+n);
        f+=sd[n-1].second;
        for(int i=n-2;i>=0;i--){
            if(sd[i].first==sd[i+1].first){
                continue;
            }
        f+=sd[i].second;
        }
        cout<<f<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long a;
    cin>>a;
    for(int e=0;e<a;e++){
        long long n;
        vector <pair<long long,long long> > sd(200000);
        cin>>n;
        long long f=0;
        int d;
        int s;
        for(int i=0;i<n;i++){
            cin>>s;
            d=0;
            if(s%2==0){
                while(s%2!=1){
                    s/=2;
                    d++;
                }
            }
            sd[i].first=s;
            sd[i].second=d;
        }
        sort(sd.begin(),sd.begin()+n);
        f+=sd[n-1].second;
        for(int i=n-2;i>=0;i--){
            if(sd[i].first==sd[i+1].first){
                continue;
            }
        f+=sd[i].second;
        }
        cout<<f;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
    long long a;
    long long n;
    long long f=0;
    long long d;
    long long s;
    vector <pair<long long,long long> > sd(200000);
    cin>>a;
    for(long long e=0;e<a;e++){
        cin>>n;
        f=0;
        for(long long i=0;i<n;i++){
            cin>>s;
            d=0;
            if(s%2==0){
                while(s%2!=1){
                    s/=2;
                    d++;
                }
            }
            sd[i].first=s;
            sd[i].second=d;
        }
        sort(sd.begin(),sd.begin()+n);
        f+=sd[n-1].second;
        for(long long i=n-2;i>=0;i--){
            if(sd[i].first==sd[i+1].first){
                continue;
            }
        f+=sd[i].second;
        }
        cout<<f<<endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
int main () {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int q;
    cin>>q;
    for (int t=0;t<q;++t){
        int n,an=0;
        cin>>n;
        map <int,int> a;
        vector <int> ans;
        for (int i=0;i<n;++i){
            int l;
            cin>>l;
            int s=0,v=1,ee=l;
            while (l%2==0){
                v*=2;
                l/=2;
                s+=1;
            }
            if (a[ee/v]==0 && ee%2==0){
                ans.push_back(ee/v);
            }
            a[ee/v]=max(a[ee/v],s);
        }
        for (int i=0;i<ans.size();++i){
            an+=a[ans[i]];
        }
        cout<<an<<"\n";

    }
}


#include <bits/stdc++.h>
using namespace std;
int main () {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int q;
    cin>>q;
    for (int t=0;t<q;++t){
        int n,ans=0;
        cin>>n;
        set <int> a;
        for (int i=0;i<n;++i){
            int l;
            cin>>l;
            if (l%2==0 && binary_search(a.begin(),a.end(),l)==false){
                a.insert(l);
                l=l/2;
                ans+=1;
                while (l%2==0 && binary_search(a.begin(),a.end(),l)==false){

                    ans+=1;
                    a.insert(l);
                    l/=2;
                }
            }
        }
        cout<<ans<<endl;

    }
}


#include <bits/stdc++.h>
#define int long long
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define pf push_front
#define x first
#define y second

typedef long long ll;

using namespace std;

const int inf = 1e10;
const int M = 998244353;
const long double pi = 3.14159265358979323846;

main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for(; t; --t){
        int n;
        cin >> n;
        set<int> a;
        for(int i = 0; i < n; ++i){
            int e;
            cin >> e;
            a.insert(e);
        }
        vector<int> del;
        for(int e: a){
            if(a.count(e * 2))del.eb(e);
        }
        for(int e: del){
            a.erase(e);
        }
        int ans = 0;
        for(int e: a){
            while(e % 2 == 0){
                ++ans;
                e /= 2;
            }
        }
        cout << ans << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
#define int long long
#define mp make_pair
#define eb emplace_back
#define pb push_back
#define pf push_front
#define x first
#define y second

typedef long long ll;

using namespace std;

const int inf = 1e10;
const int M = 998244353;
const long double pi = 3.14159265358979323846;

main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for(; t; --t){
        int n;
        cin >> n;
        set<int> a;
        for(int i = 0; i < n; ++i){
            int e;
            cin >> e;
            a.insert(e);
        }
        vector<int> del;
        for(int e: a){
            int i = 2;
            while(e * i <= *a.rbegin()){
                if(a.count(e * i))del.eb(e);
                i *= 2;
            }
        }
        for(int e: del){
            a.erase(e);
        }
        int ans = 0;
        for(int e: a){
            while(e % 2 == 0){
                ++ans;
                e /= 2;
            }
        }
        cout << ans << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
int f(ll n){
    int c = 0;
    ll ans = 0;
    while(n){
        c++;
        if(n>9)
            ans+=9;
        else{
            ans+=n-1;
        }
        n/=10;
    }
    return ans;
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while(t--){
        int n;
        cin>>n;
        set<int> s;
        for(int i=0;i<n;i++){
            int a;
            cin>>a;
            if(!(a % 2)){
                s.insert(a);
            }
        }
        ll k = 0;
        while(s.size()){
            if((*--s.end())%2){
                s.erase(--s.end());
            }
            else{
                s.insert(*(--s.end())/2);
                s.erase(*(--s.end()));
                k++;
            }
        }
        cout<<k<<'\n';

    }

    return 0;
}


#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <vector>
#include <map>

#define ll long long

using namespace std;

void solve() {
    ll n;
    cin >> n;
    set<ll> s;
    for(ll i = 0; i < n; ++i) {
        ll x;
        cin >> x;
        s.insert(x);
    }
    map<ll, ll> m;
    for(ll x : s) {
        ll c = 0;
        while((x & 1) == 0) {
            ++c;
            x >>= 1;
        }
        if(m.find(x) == m.end()) {
            m[x] = c;
        }
        m[x] = max(m[x], c);
    }
    ll rc = 0;
    for(pair<ll, ll> p : m) {
        rc += p.second;
    }
    cout << rc << '\n';
}

int main() {
    ll t;
    cin >> t;
    for(ll i = 0; i < t; ++i) {
        solve();
    }
    return 0;
}


#include <iostream>
#include <string>
#include <set>
#include <algorithm>
#include <vector>

#define ll long long

using namespace std;

void solve() {
    string s;
    cin >> s;
    vector<ll> to_rem;
    for(ll i = 0; i < s.size(); ++i) {
//        cout << i << ' ';
        ll np = i + 5;
        if(np <= s.size()) {
            string s2 = s.substr(i, 5);
            if(s2 == "twone") {
                to_rem.push_back(i + 2);
                i = np - 1;
                continue;
            }
        }
        np = i + 3;
        if(np <= s.size()) {
            string s2 = s.substr(i, 3);
//            cout << s2 << '\n';
            if(s2 == "one") {
                to_rem.push_back(i + 1);
                i = np - 1;
                continue;
            }else if(s2 == "two") {
                to_rem.push_back(i + 1);
                i = np - 1;
                continue;
            }
        }
    }
    cout << to_rem.size() << '\n';
    for(ll i : to_rem) {
        cout << i + 1 << ' ';
    }
    cout << '\n';
}

int main() {
    ll t;
    cin >> t;
    for(ll i = 0; i < t; ++i) {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int N = 2e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 1e3 + 8;
const int logN = 20, BL = 400;
const double EPS = 3e-16;

int main(){
//	freopen("ex.in", "r", stdin);
//	freopen("ex.out", "w", stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	long long q; cin >> q;
	while(q--){
		long long n; cin >> n;
		set<long long> e;
		for(long long i = 0; i < n; i++){
			long long x; cin >> x;
			if(x % 2 == 0) e.insert(x);
		}

		long long res = 0;
		while(e.size() > 0){
			vector<long long> add;
			for(set<long long>::reverse_iterator it = e.rbegin(); it != e.rend(); it++){
				if(*it % 2 == 0){
					add.push_back(*it / 2);
					res++;
					break;
				}
				else {
					e.erase(e.find(*it));
					break;
				}
			}
			for(auto i : add){
				e.erase(e.find(i * 2));
				e.insert(i);
			}
		}

		cout << res << "\n";
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/STACK:256000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")*/

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define all(n) n.begin(), n.end()
#define rall(n) n.rbegin(), n.rend()
#define P pair
#define pb push_back
#define forn(o, l) for(long long (o) = 0; (o) < (l); (o)++)
#define fore(o, l) for(auto (o) : (l))
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
const int MAXN = 1e5 + 1;
const int INF = 1000000000;
const ll INFLL = 1e18;
const int MOD = 1000000007;
const ld eps = 1e-7;
const int MXN = 2e6 + 30;

ll p, len = 0;

bool check(ll n) {
    ll last = n % 10;
    while (n != 0) {
        ll k = n % 10;
        len++;
        if (n / 10 == 0)
            p = n % 10;
        n /= 10;
    }
    return true;
}

int main() {
    fastio
    /*freopen("knapsack.in", "r", stdin);
    freopen("knapsack.out", "w", stdout);*/

    ll t;
    cin >> t;

    while (t--) {
        ll n, ans = 0;
        cin >> n;
        set<ll> s;

        forn(i, n) {
            ll x;
            cin >> x;
            s.insert(x);
        }

        while(!s.empty()){
            if(*(--s.end()) % 2 == 0){
                s.insert(*(--s.end()) / 2);
                s.erase(*(--s.end()));
                ans++;
            }
            else{
                s.erase(*(--s.end()));
            }
        }
        cout << ans << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/STACK:256000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")*/

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define all(n) n.begin(), n.end()
#define rall(n) n.rbegin(), n.rend()
#define P pair
#define pb push_back
#define forn(o, l) for(long long (o) = 0; (o) < (l); (o)++)
#define fore(o, l) for(auto (o) : (l))
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
const int MAXN = 1e5 + 1;
const int INF = 1000000000;
const ll INFLL = 1e18;
const int MOD = 1000000007;
const ld eps = 1e-7;
const int MXN = 2e6 + 30;

ll p, len = 0;

bool check(ll n) {
    ll last = n % 10;
    while (n != 0) {
        ll k = n % 10;
        len++;
        if (n / 10 == 0)
            p = n % 10;
        n /= 10;
    }
    return true;
}

int main() {
    fastio
    /*freopen("knapsack.in", "r", stdin);
    freopen("knapsack.out", "w", stdout);*/

    ll t;
    cin >> t;

    while (t--) {
        ll n, ans = 0;
        cin >> n;
        set<ll> s;
        map<ll, ll> mp;
        bool f = true;

        forn(i, n) {
            ll x;
            cin >> x;
            mp[x]++;
            s.insert(x);
        }

        while (f) {
            bool k = false;
            auto to = (--s.end());
            while(*to % 2 != 0 and to != s.begin()){
                (--to);
            }
            if (*to % 2 == 0) {
                mp[*to / 2] += mp[*to];
                ans++;
                s.insert(*to / 2);
                s.erase((--s.end()));
                k = true;
            }
            if (!k)
                f = false;
        }
        cout << ans << "\n";
    }

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma comment(linker, "/STACK:256000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")*/

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
#define all(n) n.begin(), n.end()
#define rall(n) n.rbegin(), n.rend()
#define P pair
#define pb push_back
#define forn(o, l) for(long long (o) = 0; (o) < (l); (o)++)
#define fore(o, l) for(auto (o) : (l))
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
const int MAXN = 1e5 + 1;
const int INF = 1000000000;
const ll INFLL = 1e18;
const int MOD = 1000000007;
const ld eps = 1e-7;
const int MXN = 2e6 + 30;

ll p, len = 0;

bool check(ll n) {
    ll last = n % 10;
    while (n != 0) {
        ll k = n % 10;
        len++;
        if (n / 10 == 0)
            p = n % 10;
        n /= 10;
    }
    return true;
}

int main() {
    fastio
    /*freopen("knapsack.in", "r", stdin);
    freopen("knapsack.out", "w", stdout);*/

    ll t;
    cin >> t;

    while (t--) {
        ll n, ans = 0;
        cin >> n;
        set<ll> s;
        map<ll, ll> mp;
        bool f = true;

        forn(i, n) {
            ll x;
            cin >> x;
            mp[x]++;
            s.insert(x);
        }

        while (f) {
            bool k = false;
            auto to = (--s.end());
            if (*to % 2 == 0) {
                mp[*to / 2] += mp[*to];
                ans++;
                s.insert(*to / 2);
                s.erase((--s.end()));
                k = true;
            }
            if (!k)
                f = false;
        }
        cout << ans << "\n";
    }

    return 0;
}


#include<bits/stdc++.h>

using namespace std;

int main()
{
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for (int s=0;s<t;++s)
    {
        int n;
        cin >> n;
        vector<int> A;
        int maxi = -1;
        for (int i=0;i<n;++i)
            {
                int z;
                cin >> z;
                if (z%2 == 0)
                {
                    A.push_back(z);
                    if (z > maxi)
                        maxi = z;
                }
            }
        int ans = 0;
        while (maxi != -1)
        {
            for (int i=0;i<A.size();++i)
            {
                if (A[i] == maxi)
                {
                    A[i]/=2;
                }
            }
            ans++;
            maxi = -1;
            for (int i=0;i<A.size();++i)
            {
                if (A[i] > maxi && A[i]%2 == 0)
                {
                    maxi = A[i];
                }
            }
        }
        cout << ans << "\n";

    }

}


#include<bits/stdc++.h>

using namespace std;

pair<int,int> fac(int k)
{
    int kol = 0;
    while (k%2 == 0)
        {
            k/=2;
            kol++;
        }
    return {k,kol};
}
int main()
{
    //freopen("input.txt","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    for (int s=0;s<t;++s)
    {
        int n;
        cin >> n;
        //vector<int> A;
        //int maxi = -1;
        map<int,int> M;
        for (int i=0;i<n;++i)
            {
                int z;
                cin >> z;
                if (z%2 == 0)
                {
                    //A.push_back(z);
                    pair<int,int> a = fac(z);
                    M[a.first] = max(M[a.first],a.second);
                    //if (z > maxi)
                      //  maxi = z;
                }
               // cout <<i << endl;
            }
        long long ans = 0;
        for (auto elem : M)
            ans+=elem.second;
        cout << ans << "\n";

    }

}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;

    for (int i = 0; i < t; ++i) {
        int n;
        cin >> n;

        set <pair <int, int>> S;
        for (int j = 0; j < n; ++j) {
            int x;
            cin >> x;
            int count = 0;
            while (x % 2 == 0) {
                count++;
                x /= 2;
            }
            auto itr = S.lower_bound({x, -INT32_MAX});
            if (itr == S.end() || itr->first != x) {
                S.insert({x, count});
            }
            else {
                if (itr->second < count) {
                    S.erase(itr);
                    S.insert({x, count});
                }
            }

        }
        int ans = 0;
        for (auto i : S) {
            ans += i.second;
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    int t;
    cin >> t;

    for (int i = 0; i < t; ++i) {
        int n;
        cin >> n;

        set <int> S;
        bool check = false;
        for (int j = 0; j < n; ++j) {
            int x;
            cin >> x;
            if (!check && x % 2 == 0) {
                check = true;
            }
            int count = 0;
            while (x % 2 == 0) {
                count++;
                x /= 2;
            }
            S.insert(count);
        }
        if (!check) cout << 0 << endl;
        else {
            int ans = (int) S.size() + max(0, *S.begin() - 1);
            cout << ans << endl;
        }
    }
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <iomanip>
#include <string>
#include <queue>

#define ll long long

using namespace std;

const int INF = 1e9;

int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		int n;
		cin >> n;

		set<int> st;
		for (int i = 0; i < n; i++)
		{
			int a;
			cin >> a;
			if (a % 2 == 0)
				st.insert(a);
		}

		int ans = 0;
		while (!st.empty()) {
			int val = *prev(st.end());
			st.erase(prev(st.end()));
			val /= 2;
			ans++;
			if (val % 2 == 0)
				st.insert(val);
		}
		cout << "ans: " << ans << endl;
	}
}


#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <iomanip>
#include <string>
#include <queue>

#define ll long long

using namespace std;

const int INF = 1e9;

int main()
{
	int t;
	cin >> t;
	for (int i = 0; i < t; i++)
	{
		int n;
		cin >> n;

		set<int> st;
		for (int i = 0; i < n; i++)
		{
			int a;
			cin >> a;
			if (a % 2 == 0)
				st.insert(a);
		}

		int ans = 0;
		while (!st.empty()) {
			int val = *prev(st.end());
			st.erase(prev(st.end()));
			val /= 2;
			ans++;
			if (val % 2 == 0)
				st.insert(val);
		}
		cout << ans << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  long long t, n, a, cnt;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cnt = 0;
    cin >> n;
    set<long long> s;
    for (int j = 0; j < n; ++j) {
        cin >> a;
        if (a % 2 == 0) {
            s.insert(a);
        }
    }
    while (!s.empty()) {
        long long x = *s.rbegin();
        s.erase(x);
        if (x % 2 == 0) {
            cnt++;
            s.insert(x / 2);
        }
    }
    cout << cnt << endl;
  }
  cout << "ALL";
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  long long t, n, a, cnt;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cnt = 0;
    cin >> n;
    set<long long> s;
    for (int j = 0; j < n; ++j) {
        cin >> a;
        if (a % 2 == 0) {
            s.insert(a);
        }
    }
    while (!s.empty()) {
        long long x = *s.rbegin();
        s.erase(x);
        if (x % 2 == 0) {
            cnt++;
            s.insert(x / 2);
        }
    }
    cout << cnt << endl;
  }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
  long long t, n, a, cnt;
  cin >> t;
  for (int i = 0; i < t; i < n) {
    cnt = 0;
    cin >> n;
    set<long long> s;
    for (int j = 0; j < n; ++j) {
        cin >> a;
        if (a % 2 == 0) {
            s.insert(a);
        }
    }
    while (!s.empty()) {
        long long x = *s.rbegin();
        s.erase(x);
        if (x % 2 == 0) {
            cnt++;
            s.insert(x / 2);
        }
    }
    cout << cnt << endl;
  }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

const ll MX = 2E5+10;

int main(){
    vector <int> a (MX, 0);
    int k;
    cin >> k;
    while(k){
        k--;
        int n;
        cin >> n;
        int g;
        int m = 0;
        int ans = 0;
        int pr = 0;
        set<int> u;
        priority_queue<int> q;
        for(int i = 0; i < n; ++i){
            cin >> g;
            a[g] += 1;
            u.insert(g);
            if(pr!=u.size()){
                pr = u.size();
                q.push(g);
            }
        }
        while(!q.empty()){
            int v = q.top();
            q.pop();
            if(v%2==1 | v == 1){
                continue;
            }
            else{
                // cout << v << endl;
                ans+=1;
                v=v/2;
                u.insert(v);
                if(pr!=u.size()){
                    q.push(v);
                    pr = u.size();
                }
            }
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

const ll MX = 2E5+10;

int main(){
    int k;
    cin >> k;
    while(k){
        k--;
        int n;
        cin >> n;
        int g;
        int m = 0;
        int ans = 0;
        int pr = 0;
        set<int> u;
        priority_queue<int> q;
        for(int i = 0; i < n; ++i){
            cin >> g;
            u.insert(g);
            if(pr!=u.size()){
                pr = u.size();
                q.push(g);
            }
        }
        while(!q.empty()){
            int v = q.top();
            q.pop();
            if(v%2==1 | v == 1){
                continue;
            }
            else{
                // cout << v << endl;
                ans+=1;
                v=v/2;
                u.insert(v);
                if(pr!=u.size()){
                    q.push(v);
                    pr = u.size();
                }
            }
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace std;

bool kras(int x);

int main() {
    fast_io;
//    freopen ("input.txt" , "r" , stdin);
//    freopen ("output.txt" , "w" , stdout);
    int q;
    cin >> q;
    for (int i = 0; i < q; i++) {
        set<int> st;
        int n;
        cin >> n;
        vector <int> s1;
        for (int i = 0; i < n; i++) {
            int a;
            cin >> a;
            st.insert(a);
            s1.push_back(a);
        }
        sort(s1.begin() , s1.end());
        reverse(s1.begin() , s1.end());
        int k = 0;
        for (int i = 0; i < s1.size(); i++)
            if (st.count(s1[i]) != 0) {
                int pr = s1[i];
                while (pr % 2 == 0) {
                    st.erase(pr);
//                    cout << pr << " ";
                    pr /= 2;
                    st.insert(pr);
//                    cout << pr << endl;
                    k++;
                }
            }
        cout << k << endl;
        }
    }


#include <bits/stdc++.h>

using namespace std;

const int M = 200005;

int n, t;

int main()
{
    //freopen("in.txt", "r", stdin);
    cin >> t;
    for (int i = 0; i < t; i++) {
        long long int ans = 0;
        cin >> n;
        vector <int> b;
        map <int, int> used;
        for (int j = 0; j < n; j++) {
            int a;
            cin >> a;
            if (!used[a]) {
                used[a] = b.size() + 1;
                b.push_back(a);
            }
        }
        sort(b.begin(), b.end());
        for (int j = b.size() - 1; j >= 0; j--) {
            while (b[j] % 2 == 0) {
                ans++;
                b[j] /= 2;
                if (used[b[j]]) {
                    b[used[b[j]] - 1] = 1;
                }
            }
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

const int N = 200005;

int n, t, m;

int main()
{
    //freopen("in.txt", "r", stdin);
    cin >> t;
    for (int i = 0; i < t; i++) {
        int ans = 0;
        cin >> n;
        int a[n + 1];
        vector <int> b;
        map <int, int> used;
        for (int j = 0; j < n; j++) {
            cin >> a[i];
            if (!used[a[i]]) {
                used[a[i]] = b.size() + 1;
                b.push_back(a[i]);
            }
        }
        sort(b.begin(), b.end());
        for (int j = b.size() - 1; j >= 0; j--) {
            while (b[j] % 2 == 0) {
                ans++;
                b[j] /= 2;
                if (used[b[j]]) {
                    b[used[b[j]] - 1] = 1;
                }
            }
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

const int M = 200005;

int n, t;

int main()
{
    //freopen("in.txt", "r", stdin);
    cin >> t;
    map <int, int> used1;
    for (int i = 0; i < t; i++) {
        long long int ans = 0;
        cin >> n;
        vector <int> b;
        map <int, int> used;
        for (int j = 0; j < n; j++) {
            int a;
            cin >> a;
            if (!used[a]) {
                used[a] = b.size() + 1;
                b.push_back(a);
            }
        }
        sort(b.begin(), b.end());
        for (int j = 0; j < b.size(); j++) {
            used[b[j]] = j + 1;
        }
        for (int j = b.size() - 1; j >= 0; j--) {
            while (b[j] % 2 == 0) {
                ans++;
                b[j] /= 2;
                if (b[j] % 2 == 0 && used[b[j]]) {
                    b[used[b[j]] - 1] = 1;
                }
            }
        }
        cout << ans << endl;
    }
}


#include <bits/stdc++.h>

using namespace std;

int main(){

    int t;
    cin >> t;

    int n;
    for (int j = 0; j < t; j++){
            map<int, int> m;
        int x, k = 0;
        cin >> n;
        for (int i = 0; i < n; i++){
            k = 0;
            cin >> x;
            while(x % 2 == 0){
                k++;
                x /= 2;
            }
            m[x] = max(m[x], k);
        }

        int ans = 0;

        for (auto p : m){
            ans += p.second;
        }

    cout << ans << endl;
    }

}


#include <bits/stdc++.h>

using namespace std;

//const int MOD = 1e9;

int main()
{
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        int n;
        cin >> n;
        vector<int> a(n);
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
        }
        sort(a.rbegin(), a.rend());
        set<int> st;
        int ans = 0;
        int j = 0;
        while (j < n)
        {
            while (j < n && st.find(a[j]) != st.end())
            {
                j += 1;
            }
            while (j < n && a[j] % 2 == 0)
            {
                st.insert(a[j]);
                a[j] /= 2;
                ++ans;
            }
            j += 1;
        }
        cout << ans << "\n";
    }
}


#include <bits/stdc++.h>

using namespace std;

const int MOD = 1e9;

int main()
{
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i)
    {
        int n;
        cin >> n;
        vector<int> a(n);
        for (int j = 0; j < n; ++j)
        {
            cin >> a[j];
        }
        sort(a.rbegin(), a.rend());
        set<int> st;
        int ans = 0;
        int j = 0;
        while (j < n)
        {
            while (st.find(a[j]) != st.end())
            {
                j += 1;
            }
            while (a[j] % 2 == 0)
            {
                st.insert(a[j]);
                a[j] /= 2;
                ++ans;
            }
            j += 1;
        }
        cout << ans << "\n";
    }
}


#include <bits/stdc++.h>
using namespace std;

set <int> s;

int main()
{
    int n, t = 1, ans = 0;
    set<int>::iterator l;
    cin >> t;
    while(t--){
        int x, ans = 0;
        cin >> n;
        for(int i = 0; i < n; ++i){
            cin >> x;
            s.insert(x);
        }
        while(!s.empty()){
            int Max = *s.rbegin();
            s.erase(Max);
            if(Max%2==1){
                continue;
            }
            ans++;
            s.insert(Max/2);
        }
        cout << ans << "\n";
    }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;

		vector<int> arr(n);
		for (int &i : arr) {
			cin >> i;
		}

		int counter = 0;
		while (true) {
			int maxEven = 0;
			for (int &i : arr) {
				if (i % 2 == 0 && maxEven < i) {
					maxEven = i;
				}
			}

			if (!maxEven) {
				break;
			}

			for (int &i : arr) {
				if (i == maxEven) {
					i /= 2;
				}
			}
			counter++;
		}

		cout << counter << endl;
	}
    return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	while (t--) {
		int n;
		cin >> n;

		vector<pair<int, int>> arr;
		for (int i = 0; i < n; i++) {
			int temp;
			cin >> temp;

			if (temp % 2 == 0) {
				int pos = 0;
				while (!(temp & 1)) {
					temp  = (temp >> 1);
					pos++;
				}
				arr.push_back({temp, pos});
			}
		}
		sort(arr.rbegin(), arr.rend());

		int counter = 0;
		for (int i = 0; i < arr.size(); i++){
			int maxCount = arr[i].second;
			while (i + 1 < arr.size() && arr[i].first == arr[i + 1].first) {
				maxCount = max(maxCount, arr[++i].second);
			}

			counter += maxCount;
		}

		cout << counter << endl;
	}
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <cmath>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <iomanip>
#include <stack>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ll long long
#define rc return cout <<
#define pii pair <int, int>
#define pll pair <ll, ll>
#define wh while(q--)

using namespace std;

const ll inf = 1e9 + 5;
const ll INF = 1e18 + 5;
const ll maxn = 5e5 + 5;

long long n, mx = -1000000001;
int a[555555], sum, cnt, ans;
//pair <ll, ll> a[555555];
//vector < pair < ll, ll > > v;
//ll nn = 4e18, d[105][105];
set <int> s;
pair <int, pii > p[555555];
vector <ll> v, x, y;
int aa(int n) {
	ll c = 0;
	ll cc = 0;
	ll x = n;
	vector <ll> v;
	while(x > 0)
		 v.pb(x % 10), x /= 10, c++;
	cc = (c - 1) * 9;
	c--;
	c *= 10;
	if (c == 0)
		return n;
    c = max(1ll, c);
    ll y = n;
	bool ok = 1;
	reverse(v.begin(), v.end());
	cc += v[0] - 1;
	for (ll i = 1; i < v.size(); i++)    {
		if (v[i] > v[i - 1])
			break;
		if (v[i] < v[i - 1]) {
			ok = 0;
			break;
		}
	}
//	cout << cc << endl;
	if (ok == 1)
		cc++;
	return cc;
}
map <int, int> m, b;
int main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(NULL);
	int q;
	cin >> q;
	wh {
		int n;
		cin >> n;
		for (int i = 1; i <= n; i++)
			cin >> a[i];
		for (int i = 1; i <= n; i++)
			if (a[i] % 2 == 0)
				m[a[i]] = 1;
		for (int i = 1; i <= n; i++) {
			if (m[a[i]] > 0) {
				int x = a[i];
				while(x % 2 == 0)
					x /= 2, m[x] = 0;
		   	}
		}
		for (int i = 1; i <= n; i++) {

			if (b[a[i]] == 0) {
	//			b[a[i]]++;
			if (m[a[i]] > 0) {
				int x = a[i];
				while(x % 2 == 0)
					sum++, x /= 2;
			}
			}
	        b[a[i]]++;
		}
		cout << sum << endl;
		sum = 0;
		for (int i = 1; i <= n; i++)
			m[a[i]] = 0;
	}
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <cmath>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <iomanip>
#include <stack>
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define ll long long
#define rc return cout <<
#define pii pair <int, int>
#define pll pair <ll, ll>
#define wh while(q--)

using namespace std;

const ll inf = 1e9 + 5;
const ll INF = 1e18 + 5;
const ll maxn = 5e5 + 5;

long long n, mx = -1000000001;
int a[555555], sum, cnt, ans;
//pair <ll, ll> a[555555];
//vector < pair < ll, ll > > v;
//ll nn = 4e18, d[105][105];
set <int> s;
pair <int, pii > p[555555];
vector <ll> v, x, y;
int aa(int n) {
	ll c = 0;
	ll cc = 0;
	ll x = n;
	vector <ll> v;
	while(x > 0)
		 v.pb(x % 10), x /= 10, c++;
	cc = (c - 1) * 9;
	c--;
	c *= 10;
	if (c == 0)
		return n;
    c = max(1ll, c);
    ll y = n;
	bool ok = 1;
	reverse(v.begin(), v.end());
	cc += v[0] - 1;
	for (ll i = 1; i < v.size(); i++)    {
		if (v[i] > v[i - 1])
			break;
		if (v[i] < v[i - 1]) {
			ok = 0;
			break;
		}
	}
//	cout << cc << endl;
	if (ok == 1)
		cc++;
	return cc;
}
map <int, int> m, b;
int main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(NULL);
	int q;
	cin >> q;
	wh {
		int n;
		cin >> n;
		for (int i = 1; i <= n; i++)
			cin >> a[i];
		sort(a + 1, a + n + 1);
		for (int i = 1; i <= n; i++)
			if (a[i] % 2 == 0)
				m[a[i]] = 1;
		for (int i = 1; i <= n; i++) {
			if (m[a[i]] > 0) {
				int x = a[i];
				while(x % 2 == 0)
					x /= 2, m[x] = 0;
		   	}
		}
		for (int i = 1; i <= n; i++) {

			if (b[a[i]] == 0) {
	//			b[a[i]]++;
			if (m[a[i]] > 0) {
				int x = a[i];
				while(x % 2 == 0)
					sum++, x /= 2;
			}
			}
	        b[a[i]]++;
		}
		cout << sum << endl;
		sum = 0;
		for (int i = 1; i <= n; i++)
			m[a[i]] = 0, b[a[i]] = 0;
	}
	return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>

#define int lnog long int

using namespace std;

int32_t main()
{
    int t, n, i, j, x, a, cou, sum;
    cin >> t;
    for (i = 0; i < t; i++)
    {
        cin >> n;
        map <int, int> G;
        for (j = 0; j < n; j++)
        {
            cin >> a;
            cou = 0;
            while (a % 2 == 0)
            {
                cou++;
                a = a / 2;
            }
            G[a] = max(G[a], cou);
        }
        int ans = 0;
        for (auto q = G.begin(); q != G.end(); q++)
        {
            ans = ans + q->second;
        }
        cout << ans << endl;
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>

using namespace std;

int main()
{
    int t, n, i, j, x, a, cou, sum;
    cin >> t;
    for (i = 0; i < t; i++)
    {
        cin >> n;
        map <int, int> G;
        for (j = 0; j < n; j++)
        {
            cin >> a;
            int tmpA = a;
            if (a % 2 == 0)
            {
                cou = 0;
                sum = 1;
                for (x = 2; x <= sqrt(tmpA) + 1; x++)
                {
                    if (a % x == 0)
                    {
                        if (x == 2)
                        {
                            cou++;
                        }
                        else
                        {
                            sum = sum * x;
                        }
                        a = a / x;
                        x--;
                    }
                }
                G[sum] = max(G[sum], cou);
            }
        }
        int ans = 0;
        for (auto q = G.begin(); q != G.end(); q++)
        {
            ans = ans + q->second;
        }
        cout << ans << endl;
    }
    return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <stack>

#define int long long int

using namespace std;

int32_t main()
{
    int t, n, i, j, x, a, cou, sum;
    cin >> t;
    for (i = 0; i < t; i++)
    {
        cin >> n;
        map <int, int> G;
        for (j = 0; j < n; j++)
        {
            cin >> a;
            cou = 0;
            while (a % 2 == 0)
            {
                cou++;
                a = a / 2;
            }
            G[a] = max(G[a], cou);
        }
        int ans = 0;
        for (auto q = G.begin(); q != G.end(); q++)
        {
            ans = ans + q->second;
        }
        cout << ans << endl;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		vector<int> data(n);
		for(int i=0;i<n;i++)
			cin>>data[i];
		bool done = false;
		int cnt = 0;
		while(!done){
			done = true;
			int maxx = 0;
			for(int i=0;i<n;i++){
				if(data[i]%2==0){
					done = false;
					maxx = max(data[i],maxx);
				}
			}
			if (done) break;
			for(int i=0;i<n;i++)
				if(data[i]==maxx) data[i]/=2;
			cnt++;
		}
		cout<<cnt<<endl;
	}
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>

using namespace std;

int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		vector<int> data(n);
		for(int i=0;i<n;i++)
			cin>>data[i];
		bool done = false;
		int cnt = 0;
		set<int> test;
		for(int i=0;i<n;i++){
			if(data[i]%2==0){
				while(data[i]%2==0){
					test.insert(data[i]);
					data[i]/=2;
				}
			}
		}
		cout<<test.size()<<endl;
	}
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <fstream>
#include <string>
#define pb push_back

using namespace std;

typedef vector<int> vi;

int main(){
	int t;
	cin>>t;
	while(t--){
		int n;
		cin>>n;
		vi d(n);
		for(int i=0;i<n;i++){
			cin >> d[i];
		}
		vi res;
		int curMax = d[0];
		int curMin = (curMax == 1);
		res.pb(d[0]);
		bool endd = false;
		for (int i=1;i<n;i++){
			curMax = d[i];
			if (d[i-1] == curMax) {
				if (curMax > curMin){
					cout << curMin << endl;
					res.pb(++curMin);
				} else {
					cout << "-1" << endl;
					endd = true;
				}
			}
			else {
				res.pb(curMax);
			}
		}
		if (endd) {
			continue;
		}
		for (int i=0;i<n;i++){
			cout<<res[i] << " ";
		}
		cout << endl;
	}
}


#include <bits/stdc++.h>
using namespace std;
#define ll long long

void solve()
{
    ll n;
    cin>>n;

    ll i;

    map<ll,ll>m;
    map<ll,ll>::iterator ii;
    map<ll,ll>::reverse_iterator rii;

    set<ll>s;
    set<ll>::reverse_iterator rjj;
    for(i = 0;i<n;i++)
    {
        ll z;
        cin>>z;
       if (z%2 == 0) s.insert(z);
    }

    ll cnt = 0;

    for(rjj = s.rbegin();rjj!=s.rend();rjj++)
    {
        //cout<<*rjj<<endl;
        if (*rjj % 2 == 0)
        {
        cnt++;
            s.insert(*rjj / 2);

        }

    }

   /*     for(rii = m.rbegin();rii!=m.rend();rii++)
    {
        cout<<rii->first<<" "<<rii->second<<endl;
        cnt++;
        //cout<<"We are here"<<endl;
        if (rii->first%2 == 0)
        {
        m[ rii->first / 2]++;
        cout<<rii->first/2<<endl;
        m.erase(rii->first);
        }
        else
        m.erase(rii->first);
    }*/

    cout<<cnt<<endl;

}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
        ll n;
        cin>>n;

    while(n--)

    {
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--) {
        int n, cnt = 0;
        cin >> n;
        vector <bool> used(1e9, 0);
        for (int i = 0; i < n; ++i) {
            int k;
            cin >> k;
            if (2 * (k >> 1) != k) continue;
            while (2 * (k >> 1) == k && used[k] == 0) {
                used[k] = 1;
                ++cnt;
                k = k >> 1;
            }
        }
        cout << cnt << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--) {
        int n, cnt = 0;
        cin >> n;
        set <int> my_used;
        for (int i = 0; i < n; ++i) {
            int k;
            cin >> k;
            if (2 * (k >> 1) != k) continue;
            while (2 * (k >> 1) == k && my_used.find(k) != my_used.end()) {
                my_used.insert(k);
                ++cnt;
                k = k >> 1;
            }
        }
        cout << cnt << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--) {
        int n, cnt = 0;
        cin >> n;
        set <int> my_used;
        for (int i = 0; i < n; ++i) {
            int k;
            cin >> k;
            if (2 * (k >> 1) != k) continue;
            while (2 * (k >> 1) == k && my_used.find(k) == my_used.end()) {
                my_used.insert(k);
                ++cnt;
                k = k >> 1;
            }
        }
        cout << cnt << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector <int> data(n);
        for (int i = 0; i < n; ++i) cin >> data[i];
        vector <bool> used(1e9, 0);
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            int m = data[i];
            while (m % 2 == 0 && used[m] == 0) {
                used[m] = 1;
                ++cnt;
                m = m / 2;
            }
        }
        cout << cnt << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector <int> data(n);
        for (int i = 0; i < n; ++i) cin >> data[i];
        vector <bool> used(1e9, 0);
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            int m = data[i];
            while (2 * (m >> 1) == m && used[m] == 0) {
                used[m] = 1;
                ++cnt;
                m = m >> 1;
            }
        }
        cout << cnt << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
long long a,q,arc;
map<int,int>c;
long long sum,l;
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>q;
    for(int ij=0;ij<q;ij++){
        cin>>a;
        sum =0;
        for(int i=0;i<a;i++){
            cin>>arc;
            l=0;
            while(arc%2==0){
                arc/=2;
                l++;
            }
            if(c[arc]<l){
                sum -= c[arc];
                sum+=l;
                c[arc]=l;
            }
        }
        cout<<sum<<"\n";
        c.clear();
    }
}


#include <bits/stdc++.h>

using namespace std;
int a,q,arc,c[200000],l;
long long sum;
set<int>S;
int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>q;
    for(int ij=0;ij<q;ij++){
        cin>>a;
        sum =0;
        for(int i=0;i<a;i++){
            cin>>arc;
            l=0;
            while(arc%2==0){
                arc/=2;
                l++;
            }
            if(c[arc]<l){
                sum -= c[arc];
                sum+=l;
                c[arc]=l;
                S.insert(arc);
            }
        }
        cout<<sum<<"\n";
        for(auto ar:S){
            c[ar]=0;
        }
        S.clear();
    }
}


#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/STACK:100000000000")
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <stdio.h>
#include <cstdio>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <cstring>
#include <stack>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <deque>
#include <bitset>
#include <time.h>
#include <random>
#include <array>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define pii pair <int, int>
#define pll pair <ll, ll>
#define pdi pair <double, int>
#define all(x) x.begin(), x.end()

int const INF = 1e9;
int const MOD = 1e9;
double const PI = 3.14159265359;

int sti(string s) {
	int ans = 0;
	for (int i = 0; i < s.size(); i++) {
		ans = ans * 10 + (s[i] - '0');
	}
	return ans;
}
int mn(string s) {
	int mn = 1e9;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == '0') continue;
		mn = min(mn, s[i] - '0');
	}
	return mn;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int q;
	cin >> q;
	for (int z = 0; z < q; z++) {
		int n;
		cin >> n;
		set<int>a;
		for (int i = 0; i < n; i++) {
			int x;
			cin >> x;
			if (x % 2 == 0) a.insert(x);
		}
		int ans = 0;
		while (a.size()) {
			set<int>::iterator it = a.end();
			it--;
			int b = *it;
			a.erase(it);
//			cout << b << " ";
			if ((b / 2)  % 2 == 0) {
				a.insert(b / 2);
			}
			ans++;
		}
		cout <<  ans << endl;
	}
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

signed main()
{
    int t;
    cin >> t;
    while(t--){
        int n;
        set <int> st;
        cin >> n;
        for (int i = 0; i < n; ++i){
            int a;
            cin >> a;
            if (!(a%2))
                st.insert(a);
        }
        int ans = 0;
        while(st.size()){
                int v = (*(st.rbegin()));
                st.erase(v);
                if (!(v%2)){
                    st.insert(v/2);
                    ans++;
                }
        }
        cout << ans << '\n';
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;

int q;
string s;
set<int> st;
main(){
    ios_base::sync_with_stdio(false);
    cin>>q;
    while(q--){
        int cnt=0;
        int n;
        cin >> n;
        for(int i = 1; i <= n; i ++){
            int x;
            cin >> x;
            if(x %2==0)
            st.insert(x);
        }
        while(st.size()){
            int x = *st.rbegin();
            st.erase(x);
            x/=2;
            if(x%2==0)
                st.insert(x);
            cnt++;
        }
        cout << cnt << endl;
    }
}


#include<iostream>
#include<vector>
#include<string>
#include<iomanip>
#include<set>
#include<unordered_map>
#include<map>
#include<unordered_set>
#include<algorithm>
#define int long long

using namespace std;

signed main() {
    int t;
    cin >> t;
    for (int i = 0; i < t; ++i) {
        int n;
        cin >> n;
        map<int, int> mp;
        vector<int>vec(n);
        for (int i = 0; i < n; ++i) {
            cin >> vec[i];
        }
        sort(vec.rbegin(), vec.rend());
        int cnt = 0;
        for (int i = 0; i < n; ++i) {
            while (vec[i] % 2 == 0) {
                if (mp.find(vec[i]) == mp.end()) {
                    ++cnt;
                    mp[vec[i]] = 1;
                    vec[i] /= 2;
                }
                else
                    break;
            }
        }
        cout << cnt << '\n';
    }
    return 0;
}


#include <bits/stdc++.h>
typedef long long ll;
const ll MOD = 1e9+7;
using namespace std;

bool b[1000000001];

int main(){
#ifndef ONLINE_JUDGE
    freopen("inp.txt", "r", stdin );
    freopen("ans.txt", "w", stdout);
#endif // ONLINE_JUDGE
    ios::sync_with_stdio(false); cin.tie(0);
    int T; cin >> T;
    while(T--){
        int n; cin >> n;
        set<int> a;
        for(int i=0; i<n; i++){
            int t; cin >> t;
            if(t%2) continue;
            a.insert(t);
        }
        int c = 0;
        while(a.size()){
            ++c;
            int t = *(--a.end());
            a.erase(t);
            t/=2;
            if(t%2) continue;
            a.insert(t);
        }
        cout << c << '\n';
    }
}


#include <bits/stdc++.h>
typedef long long ll;
const ll MOD = 1e9+7;
using namespace std;

int main(){
#ifndef ONLINE_JUDGE
    freopen("inp.txt", "r", stdin );
    freopen("ans.txt", "w", stdout);
#endif // ONLINE_JUDGE
    ios::sync_with_stdio(false); cin.tie(0);
    int T; cin >> T;
    while(T--){
        int n; cin >> n;
        set<int> a;
        for(int i=0; i<n; i++){
            int t; cin >> t;
            if(t%2) continue;
            a.insert(t);
        }
        int c = 0;
        while(a.size()){
            ++c;
            int t = *(--a.end());
            a.erase(t);
            t/=2;
            if(t%2) continue;
            a.insert(t);
        }
        cout << c << '\n';
    }
}


#define _CRT_SECURE_NO_WARNINGS_
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <math.h>

using namespace std;

typedef long long ll;

int h, w, k, n, t;
ll a, res, m, f;
vector<ll> v;
set<ll> s;

int main() {
	cin >> t;
	for (int i = 0; i < t; ++i) {
		cin >> n;
		for (int j = 0; j < n; ++j) {
			cin >> a;
			if (a % 2 == 0)
				s.insert(a);
		}
		res = 0;
		while (!s.empty()) {
			f = *s.rbegin();
			s.erase(f);
			f /= 2;
			if (f % 2 == 0)
				s.insert(f);
			++res;
		}
		cout << res << endl;
		s.clear();
	}

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS_
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <math.h>

using namespace std;

typedef long long ll;

int h, w, k, n, t;
ll a, res, m, f;
vector<ll> v;
set<ll> s;

int main() {
	cin >> t;
	for (int i = 0; i < t; ++i) {
		cin >> n;
		for (int j = 0; j < n; ++j) {
			cin >> a;
			s.insert(a);
		}
		res = 0;
		while (*s.rbegin() % 2 == 0) {
			f = *s.rbegin();
			s.erase(f);
			f /= 2;
			s.insert(f);
			++res;
		}
		cout << res;
		s.clear();
	}

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS_
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <set>
#include <map>
#include <math.h>

using namespace std;

typedef long long ll;

int h, w, k, n, t;
ll a, res, m, f;
vector<ll> v;
set<ll> s;

int main() {
	cin >> t;
	for (int i = 0; i < t; ++i) {
		cin >> n;
		for (int j = 0; j < n; ++j) {
			cin >> a;
			s.insert(a);
		}
		res = 0;
		while (*s.rbegin() % 2 == 0) {
			f = *s.rbegin();
			s.erase(f);
			f /= 2;
			s.insert(f);
			++res;
		}
		cout << res << endl;
		s.clear();
	}

	return 0;
}


    #include <bits/stdc++.h>
    using namespace std;
    #define ll long long

    int main(){
    	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    	ll t, n, a, ans; cin>>t;
    	set <ll> s;
    	for (int i=0;i<t;i++){
    		cin>>n;
    		ans=0;
    		for (int j=0;j<n;j++){
        		cin>>a;
        		if (a%2==1) continue;
        		s.insert(a);
        	}
        	while (!s.empty()){
        	    a=*(--s.end());
        	    s.erase(a);
        	    while (a%2==0){
        	        a/=2;
        	        if (s.count(a)){ s.erase(a);}
            	    ans++;
            	}
        	}
        	cout<<ans<<'\n';
    	}
    	return 0;
    }


#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <algorithm>

using namespace std;

bool comp(int a, int b)
{
	return (a > b);
}

void solve()
{
	int n;
	cin >> n;
	map<long long, int> a;
	for (int i = 0; i < n; i++)
	{
		long long t;
		cin >> t;
		if (t % 2 == 0)
			a[t]++;
	}
	int res = 0;
	while (a.size() != 0)
	{
		auto it = a.end();
		it--;
		long long temp = it->first / 2;
		a.erase(it);
		if (temp % 2 == 0)
			a[temp]++;
		res++;
	}
	cout << res << endl;
}

int main()
{
	int t;
	cin >> t;
	while (t--)
		solve();
	return 0;
}


//#define _GLIBCXX_DEBUG
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <unordered_set>
#include <time.h>
#define all(x) (x).begin(), (x).end()
#define raint(x) (x).rbegin(), (x).rend()
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;

const int INF = 1e9;

int main() {
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");
	ios::sync_with_stdio(0);
	cin.tie(0);

	int t;
	int n;
	cin >> t;
	for (int q = 0; q < t; q++) {
		cin >> n;
		int ans = 0;
		vector<int> f;
		while (n) {
			f.pb(n % 10);
			n /= 10;
		}
		reverse(all(f));
		bool ok = 1;
		for (int i = 1; i < f.size(); i++) {
			if (f[i] - f[i - 1] > 1)
				break;
			else
				if (f[i] - f[i - 1] < 0)
					ok = 0;
		}
		//for (int i = 0; i < f.size(); i++)
		//	cout << f[i] << ' ';
		if (f.size() > 1 && ok) {
			ans += f[0];
			ans += (f.size() - 1) * 9;
		}
		else if (f.size() == 1) {
			ans = f[0];
		}
		else {
			ans += f[0] - 1;
			if(f[0] == 1)
				ans += (f.size() - 1) * 9;
		}
		cout << ans << endl;
	}

	return 0;
}


//#define _GLIBCXX_DEBUG
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <string>
#include <cmath>
#include <algorithm>
#include <iterator>
#include <unordered_set>
#include <time.h>
#define all(x) (x).begin(), (x).end()
#define raint(x) (x).rbegin(), (x).rend()
#define pb push_back
typedef long long ll;
typedef long double ld;
using namespace std;

const int INF = 1e9;

int main() {
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");
	ios::sync_with_stdio(0);
	cin.tie(0);

	int t;
	int n;
	cin >> t;
	for (int q = 0; q < t; q++) {
		cin >> n;
		vector<int> f(n);
		for (int i = 0; i < n; i++)
			cin >> f[i];
		set<int> ans;
		for (int i = 0; i < n; i++) {
			while (f[i] % 2 == 0) {
				ans.insert(f[i]);
				f[i] /= 2;
			}
		}
		cout << ans.size() << endl;
	}

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(m) m.begin(),m.end()
#define all_mas(m) for(auto &i: m) cout << i << ' ';\
cout << endl;

int st (int n) {
    int ans = 0;
    while(n%2 == 0) {
        ans++;
        n/=2;
    }
    return ans;
}

signed main() {
    ios::sync_with_stdio(0);
    //freopen("input.txt", "r+", stdin);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector <int> mas(n);
        for  (auto &i: mas)
            cin >> i;
        int ans = 0;
        set < pair <int, int>, greater<pair <int, int> > > a;
        for (int i = 0; i < n; ++i) {
            int t = st(mas[i]);
        if (t != 0)
            a.insert({t, mas[i]});
        }
        while (a.size() > 0) {
            pair <int, int> it = *a.begin();
            a.erase(a.begin());
            it.first--; it.second/=2;
            if (it.first!=0)
                a.insert(it);
           ans++;
        }
        cout << ans << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(m) m.begin(),m.end()
#define all_mas(m) for(auto &i: m) cout << i << ' ';\
cout << endl;

int st (int n) {
    int ans = 0;
    while(n%2 == 0) {
        ans++;
        n/=2;
    }
    return ans;
}

signed main() {
    ios::sync_with_stdio(0);
    //freopen("input.txt", "r+", stdin);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector <int> mas(n);
        for  (auto &i: mas)
            cin >> i;
        int ans = 0;
        while (1) {
            map <pair<int, int>, vector<int>> a;
            for (int i = 0; i < n; ++i) {
                int t = st(mas[i]);
                if (t != 0)
                    a[ {t, mas[i]}].push_back(i);
            }
            if (a.size() == 0)
                break;
            auto it = a.rbegin();
            for (auto &i: it->second) {
                mas[i]/=2;
            }
            ans++;
        }
        cout << ans << endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(m) m.begin(),m.end()
#define all_mas(m) for(auto &i: m) cout << i << ' ';\
cout << endl;

int st (int n) {
    int ans = 0;
    while(n%2 == 0) {
        ans++;
        n/=2;
    }
    return ans;
}

signed main() {
    ios::sync_with_stdio(0);
    freopen("input.txt", "r+", stdin);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        vector <int> mas(n);
        for  (auto &i: mas)
            cin >> i;
        int ans = 0;
        set < pair <int, int>, greater<pair <int, int> > > a;
        for (int i = 0; i < n; ++i) {
            int t = st(mas[i]);
        if (t != 0)
            a.insert({t, mas[i]});
        }
        while (a.size() > 0) {
            pair <int, int> it = *a.begin();
            a.erase(a.begin());
            it.first--; it.second/=2;
            if (it.first!=0)
                a.insert(it);
           ans++;
        }
        cout << ans << endl;
    }
    return 0;
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
using namespace std;

bool comp(int a, int b) {
	return a > b;
}

int main() {
	ios_base::sync_with_stdio(false);
	int t;
	cin >> t;
	vector<int> s(t);
	for (int i = 0; i < t; i++) {
		set<int> a;
		int n;
		cin >> n;
		int k = 0;
		vector<int> c(n);
		for (int j = 0; j < n; j++) {
			cin >> c[j];
		}
		sort(c.begin(), c.end(), comp);
		for (int j = 0;j < n;j++){
			if (a.find(c[j]) == a.end()) {
				while (c[j] % 2 == 0) {
					a.insert(c[j]);
					k++;
					c[j] = c[j] / 2;
				}
			}
		}
		s[i] = k;
	}
	for (int i = 0; i < t; i++) {
		cout << s[i] << '\n';
	}
}


#include <iostream>
#include <string>
#include <map>
#include <algorithm>
#include <vector>
#include <queue>
#include <stdio.h>
#include <deque>
#include <set>

using namespace std;

typedef long long ll;
map<int, int> mp;

int main() {
	ll tt;
	cin >> tt;
	for (int i = 0; i < tt; i++) {
		int n;
		cin >> n;
		for (int j = 0; j < n; j++) {
			int x;
			cin >> x;
			if (x % 2 == 0) {
				mp[x] ++;
			}
		}
		int cnt = 0;
		while (!mp.empty()) {
			auto itt = mp.end();
			itt--;
			if ((itt->first / 2) % 2 == 0)
				mp[itt->first / 2] += itt->second;
			mp.erase(itt);
			cnt++;
		}
		cout << cnt << endl;
		mp.clear();
	}
//	system("pause");
	return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<limits>
#include<cmath>
#include<string>
#include<cstdio>
#include <fstream>
#include <stdlib.h>

using namespace std;

#define ll long long

int size(int n) {

	int count = 0;
	while (n > 0) {
		count++;
		n /= 10;
	}
	return count;
}
int check(int n) {
	string s = to_string(n);
	int mx = s[0] - '0';
	for (int i = 1; i < s.size(); ++i) {
		if (s[i] - '0' < mx) return max(mx - 1, 0);
	}
	return mx;
}

void pr(set<int> a) {
	for (auto& i : a) {
		cout << i << ' ';
	}
	cout << endl;
}

int main()
{
	int t; cin >> t;
	while (t--) {

		int n; cin >> n;
		set<int> a;
		for (int i = 0; i < n; ++i) {
			int x; cin >> x;
			if (x % 2 == 0) a.insert(x);
		}
		int ans = 0;

		while (!a.empty()) {

			auto it = a.end(); --it;

			int x = *it;
			a.erase(it);
			if ((x / 2) % 2 == 0 && (x / 2) != 0)
				a.insert(x / 2);
			++ans;

		}
		cout << ans << endl;

	}

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <climits>
#include <deque>
#include <cstdlib>
#include <cstdio>
#include <bitset>

#define ll long long
#define ull unsigned ll
#define db double
#define ldb long db
#define sbe(a) a.begin(), a.end()
#define srbe(a) a.rbegin(), a.rend()
#define pii pair<int, int>

using namespace std;

void solve() {
    int n, k;
    cin >> n;
    multiset<int> a;
    for (int i = 0; i < n; ++i) {
        cin >> k;
        if (k % 2 == 0)
            a.emplace(-k);
    }
    int ans = 0;
    while (!a.empty()) {
        int it = *a.begin();
        int k = a.count(it);
        a.erase(it);
        if (((-it) / 2) % 2 == 0)
            for (int i = 0; i < k; ++i) {
                a.emplace(it / 2);
            }
        ++ans;
    }
    cout << ans << '\n';
}

signed main() {
    cin.tie(NULL);
    cout.tie(NULL);
    ios_base::sync_with_stdio(false);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    cin >> t;
    while (t--)
        solve();
    return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define pii pair<int, int>
#define pll pair<long, long>
#define pss pair<string, string>
#define forn(n,i) for (int i = 0; i < n; i++)
#define fordown(n,i) for (int i = n - 1; i >= 0; --i)
#define sorted(a) sort(a.begin(), a.end())
#define mp(x, y) make_pair(x, y)

#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cmath>
#include <string>
#include <string.h>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#include <time.h>
#include <random>

using namespace std;

typedef long long ll;
typedef double db;
typedef long double ldb;

ll t;
ll n;
ll a[200010];
set <ll> s;

int main() {
//	freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	cin >> t;
	forn(t, ind) {
		s.clear();
		cin >> n;
		forn(n, i) {
			cin >> a[i];
			while (a[i] % 2 == 0) {
				s.insert(a[i]);
				a[i] /= 2;
			}
		}
		cout << s.size() << endl;
	}
}


#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<bitset>
#include<algorithm>
#include<unordered_map>
#include<unordered_set>
#include<cmath>
#include<deque>
#include<set>
#include<map>
#include<queue>
using namespace std;
typedef long long ll;

#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")

void solve() {
    int t; cin >> t;
    for (int t1 = 0; t1 < t; t1++) {
        int n; cin >> n;
        set<int>s;
        for (int i = 0; i < n; i++) {
            int a; cin >> a;
            while (a % 2 == 0) {
                s.insert(a);
                a /= 2;
            }
        }
        cout << s.size()<<'\n';
    }
}
int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    solve();
}


#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iterator>
#include <stack>
#include <utility>
#include <queue>
#include <map>
#include <set>
#include <limits.h>
#include <iomanip>
#include <unordered_map>

#define _USE_MATH_DEFINES
#include <math.h>
#include <cmath>

#define print(i) cout << i << endl
#define pb push_back
#define INF 100000000
#define mp make_pair

typedef long long llong;

using namespace std;

vector<vector<int>> graph;

int two(int n) {
	int ans = 0;
	while (n % 2 == 0) {
		n /= 2;
		ans++;
	}
	return ans;
}

int binpow(int a, int b) {
	if (b == 0) {
		return 1;
	}
	if (b % 2) {
		return a * binpow(a, b - 1);
	}
	else {
		int d = binpow(a, b / 2);
		return d * d;
	}
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int N;
	cin >> N;
	for (int t = 0; t < N; t++) {
		int n;
		cin >> n;
		// set<int> nums;
		map<int, int> ans;
		int mx = 0;
		vector<int> nums;
		for (int i = 0; i < n; i++) {
			int num;
			cin >> num;
			// nums.insert(num);
			mx = max(mx, num);
			nums.pb(num);
		}
		for (int num : nums) {
			if (num % 2 == 0) {

				int l = two(num);
				// print(l);
				int k = num / binpow(2, l);
				// print(k);
				if (ans.count(k)) {
					ans[k] = max(ans[k], l);
				}
				else {
					ans[k] = l;
				}
			}
		}
		int ANS = 0;
		for (auto p : ans) {
			ANS += p.second;
		}
		print(ANS);
		// print("~~");
	}
	return 0;
}