#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll prime[1000005];
ll arr[1000005];
ll mulmod(ll a, ll b, ll c)
{
ll x = 0, y = a % c;
while (b)
{
if (b & 1)
x = (x + y) % c;
y = (y << 1) % c;
b >>= 1;
}
return x % c;
}
ll fastPow(ll x, ll n, ll MOD)
{
ll ret = 1;
while (n)
{
if (n & 1)
ret = mulmod(ret, x, MOD);
x = mulmod(x, x, MOD);
n >>= 1;
}
return ret % MOD;
}
bool isPrime(ll n)
{
if(n == 2 || n == 3)
return true;
if(n == 1 || !(n & 1))
return false;
ll d = n - 1;
int s = 0;
while (d % 2 == 0)
{
s++;
d /= 2;
}
int a[9] = { 2, 3, 5, 7, 11, 13, 17, 19, 23 };
for(int i = 0; i < 9; i++)
{
if(n == a[i])
return true;
bool comp = fastPow(a[i], d, n) != 1;
if(comp)
for(int j = 0; j < s; j++)
{
ll fp = fastPow(a[i], (1LL << (ll)j)*d, n);
if (fp == n - 1)
{
comp = false;
break;
}
}
if(comp)
return false;
}
return true;
}
void prime_gen()
{
for(ll i=4; i<=1000000; i+=2)
arr[i]=1;
for(ll i=3; i*i<=1000000; i+=2)
{
if(arr[i]==0)
{
for(ll j=i*i; j<=1000000; j+=2*i)
{
arr[j]=1;
}
}
}
prime[0]=2;
ll j;
for(ll i=3,j=1; i<=1000000; i+=2)
{
if(arr[i]==0)
{
prime[j++]=i;
}
}
return;
}
int main()
{
prime_gen();
ll i,j,n,m,t;
scanf("%lld",&t);
for(ll tes=0; tes<t; tes++)
{
scanf("%lld",&n);
ll cnt=0,ans=1;
for(i=0;; i++)
{
cnt=0;
if(prime[i]!=0&&prime[i]*prime[i]*prime[i]<=n)
{
while(n%prime[i]==0)
{
n/=prime[i];
cnt++;
}
ans*=(cnt+1);
}
else
break;
}
ll y=sqrt(n*1.0);
if(isPrime(n))
{
ans*=2;
}
else if(isPrime(y)&&y*y==n)
{
ans*=3;
}
else if(n!=1)
{
ans*=4;
}
cout<<ans<<endl;
}
return 0;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNkZWZpbmUgbGwgbG9uZyBsb25nCmxsIHByaW1lWzEwMDAwMDVdOwpsbCBhcnJbMTAwMDAwNV07CgoKbGwgbXVsbW9kKGxsIGEsIGxsIGIsIGxsIGMpCnsKICAgIGxsIHggPSAwLCB5ID0gYSAlIGM7CiAgICB3aGlsZSAoYikKICAgIHsKICAgICAgICBpZiAoYiAmIDEpCiAgICAgICAgICAgIHggPSAoeCArIHkpICUgYzsKICAgICAgICB5ID0gKHkgPDwgMSkgJSBjOwogICAgICAgIGIgPj49IDE7CiAgICB9CiAgICByZXR1cm4geCAlIGM7Cn0KbGwgZmFzdFBvdyhsbCB4LCBsbCBuLCBsbCBNT0QpCnsKICAgIGxsIHJldCA9IDE7CiAgICB3aGlsZSAobikKICAgIHsKICAgICAgICBpZiAobiAmIDEpCiAgICAgICAgICAgIHJldCA9IG11bG1vZChyZXQsIHgsIE1PRCk7CiAgICAgICAgeCA9IG11bG1vZCh4LCB4LCBNT0QpOwogICAgICAgIG4gPj49IDE7CiAgICB9CiAgICByZXR1cm4gcmV0ICUgTU9EOwp9CmJvb2wgaXNQcmltZShsbCBuKQp7CiAgICBpZihuID09IDIgfHwgbiA9PSAzKQogICAgICAgIHJldHVybiB0cnVlOwogICAgaWYobiA9PSAxIHx8ICEobiAmIDEpKQogICAgICAgIHJldHVybiBmYWxzZTsKICAgIGxsIGQgPSBuIC0gMTsKICAgIGludCBzID0gMDsKICAgIHdoaWxlIChkICUgMiA9PSAwKQogICAgewogICAgICAgIHMrKzsKICAgICAgICBkIC89IDI7CiAgICB9CiAgICBpbnQgYVs5XSA9IHsgMiwgMywgNSwgNywgMTEsIDEzLCAxNywgMTksIDIzIH07CiAgICBmb3IoaW50IGkgPSAwOyBpIDwgOTsgaSsrKQogICAgewogICAgICAgIGlmKG4gPT0gYVtpXSkKICAgICAgICAgICAgcmV0dXJuIHRydWU7CiAgICAgICAgYm9vbCBjb21wID0gZmFzdFBvdyhhW2ldLCBkLCBuKSAhPSAxOwogICAgICAgIGlmKGNvbXApCiAgICAgICAgICAgIGZvcihpbnQgaiA9IDA7IGogPCBzOyBqKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGxsIGZwID0gZmFzdFBvdyhhW2ldLCAoMUxMIDw8IChsbClqKSpkLCBuKTsKICAgICAgICAgICAgICAgIGlmIChmcCA9PSBuIC0gMSkKICAgICAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICAgICBjb21wID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICBpZihjb21wKQogICAgICAgICAgICByZXR1cm4gZmFsc2U7CiAgICB9CiAgICByZXR1cm4gdHJ1ZTsKfQoKCnZvaWQgcHJpbWVfZ2VuKCkKewoKICAgIGZvcihsbCBpPTQ7IGk8PTEwMDAwMDA7IGkrPTIpCiAgICAgICAgYXJyW2ldPTE7CgogICAgZm9yKGxsIGk9MzsgaSppPD0xMDAwMDAwOyBpKz0yKQogICAgewogICAgICAgIGlmKGFycltpXT09MCkKICAgICAgICB7CiAgICAgICAgICAgIGZvcihsbCBqPWkqaTsgajw9MTAwMDAwMDsgais9MippKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBhcnJbal09MTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgIH0KICAgIHByaW1lWzBdPTI7CiAgICBsbCBqOwogICAgZm9yKGxsIGk9MyxqPTE7IGk8PTEwMDAwMDA7IGkrPTIpCiAgICB7CiAgICAgICAgaWYoYXJyW2ldPT0wKQogICAgICAgIHsKICAgICAgICAgICAgcHJpbWVbaisrXT1pOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybjsKfQoKCmludCBtYWluKCkKewogICAgcHJpbWVfZ2VuKCk7CiAgICBsbCBpLGosbixtLHQ7CiAgICBzY2FuZigiJWxsZCIsJnQpOwoKICAgIGZvcihsbCB0ZXM9MDsgdGVzPHQ7IHRlcysrKQogICAgewogICAgICAgIHNjYW5mKCIlbGxkIiwmbik7CiAgICAgICAgbGwgY250PTAsYW5zPTE7CiAgICAgICAgZm9yKGk9MDs7IGkrKykKICAgICAgICB7CiAgICAgICAgICAgIGNudD0wOwogICAgICAgICAgICBpZihwcmltZVtpXSE9MCYmcHJpbWVbaV0qcHJpbWVbaV0qcHJpbWVbaV08PW4pCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHdoaWxlKG4lcHJpbWVbaV09PTApCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgbi89cHJpbWVbaV07CiAgICAgICAgICAgICAgICAgICAgY250Kys7CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICBhbnMqPShjbnQrMSk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgZWxzZQogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgfQogICAgICAgIGxsIHk9c3FydChuKjEuMCk7CiAgICAgICAgaWYoaXNQcmltZShuKSkKICAgICAgICB7CiAgICAgICAgICAgIGFucyo9MjsKICAgICAgICB9CiAgICAgICAgZWxzZSBpZihpc1ByaW1lKHkpJiZ5Knk9PW4pCiAgICAgICAgewogICAgICAgICAgICBhbnMqPTM7CiAgICAgICAgfQogICAgICAgIGVsc2UgaWYobiE9MSkKICAgICAgICB7CiAgICAgICAgICAgIGFucyo9NDsKICAgICAgICB9CgogICAgICAgIGNvdXQ8PGFuczw8ZW5kbDsKICAgIH0KICAgIHJldHVybiAwOwp9Cg==