/*------- OPTIMIZE -------*/
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O2")
/*------- INCLUDE -------*/
#include<bits/stdc++.h>
/*------- MACROS -------*/
#define int long long
#define pb push_back
#define fi first
#define se second
#define is insert
#define _it ::iterator
#define FOR(i,l,r,n) for((i)=(l);(i)<=(r);(i)+=(n))
#define FOD(i,r,l,n) for((i)=(r);(i)>=(l);(i)-=(n))
#define lowerbound(v,x) lower_bound((v).begin(),(v).end(),(x))
#define upperbound(v,x) upper_bound((v).begin(),(v).end(),(x))
#define all(v) (v).begin(),(v).end()
using namespace std;
/*------- CONSTANT -------*/
const double pi=3.141592653589;
const int mod=1e9+7;
const int llm=LONG_LONG_MAX;
/*--- SOLVING FUNCTIONS ---*/
int f[1000001]={},uoc; vector<int> v;
void sangnto(int n) //sang nguyen to, tao mang chi gom cac so nguyen to
{
int i,j;
FOR(i,2,sqrt(n),1)
{
if (f[i]==0) {FOR(j,i,n/i,1) f[i*j]=1;}
}
v.pb(2);
FOR(i,3,n,2) {if (f[i]==0) v.pb(i);}
}
void demuoc(int x) //dem uoc bang phan tich thua so nguyen to + mang nguyen to
{ uoc=1;
if (x==1) {cout<<1<<endl; return;}
if (f[x]==0) {cout<<2<<endl; return;}
int i,d,x1=x;
FOR(i,0,v.size()-1,1)
{ d=0;
if (v[i]>sqrt(x1)||x==1) break;
if (x%v[i]==0)
{
while (x%v[i]==0) {x=x/v[i]; d++;}
}
uoc=uoc*(d+1);
}
if (x!=1) uoc=uoc*2;
cout<<uoc<<endl;
}
void run()
{
int n,x,i;
cin>>n; sangnto(1000000);
FOR(i,1,n,1)
{
cin>>x; demuoc(x);
}
}
/*--------- MAIN ---------*/
signed main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// freopen(" .inp","r",stdin);
// freopen(" .out","w",stdout);
run();
return 0;
}
LyotLS0tLS0tIE9QVElNSVpFIC0tLS0tLS0qLwojcHJhZ21hIEdDQyBvcHRpbWl6ZSgiT2Zhc3QiK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