#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type, less_equal<int>,rb_tree_tag, tree_order_statistics_node_update>ordered_set;
typedef long long int ll;
typedef unsigned long long int ull;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef pair<int,int>pr;
#define mp make_pair
#define all(i) i.begin() , i.end()
#define ft first
#define sn second
#define pb push_back
#define eps 1e-9
#define SP cout<<fixed<<setprecision(10);
/// BISMILLHIR RAHMANIR RAHIM
///------------------------------------------------------------
#define YES cout<<"YES\n";
#define NO cout<<"NO\n";
#define dbg cout<<"rony\n";
#define setbit(n,k) n&(1 << (k-1))
#define inf 100000
#define MAXN 10000005
const int mod = 998244353;
vector<ll>v;
bool prime[MAXN];
void sieve()
{
v.pb(2);
for(ll i=3;i*i<MAXN;i+=2)
{
if(prime[i] == false){
for(ll j=i*i;j<MAXN;j+= 2*i)
prime[j] = true;
}
}
for(int i=3;i<MAXN;i+= 2) if(prime[i] == false) v.pb(i);
}
void solve()
{
ll n;
cin >> n;
ll an =1;
for(ll i = 0;i < v.size() && v[i]*v[i] <= n;i++)
{
if(n%v[i] == 0)
{
ll a = 0;
while(n%v[i] == 0)
{
n /= v[i];
a++;
}
// cout<<i<<" "<<a<<endl;
an *= (( 2LL*a) + 1LL);
}
}
if(n != 1)
{
an *= 3LL;
}
cout<<(an + 1LL)/2LL<<endl;
//cout<<an<<endl;
}
int main()
{
IOS;
ll t;
//t = 1;
cin >> t;
sieve();
int c = 0;
while ( t-- )
{
cout<<"Case "<<++c<<": ";
solve();
}
return 0;
}
/// A L H A M D U L I L L A H
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNpbmNsdWRlIDxleHQvcGJfZHMvYXNzb2NfY29udGFpbmVyLmhwcD4KI2luY2x1ZGUgPGV4dC9wYl9kcy90cmVlX3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2lldmUoKQp7CiAgICB2LnBiKDIpOwogICAgZm9yKGxsIGk9MztpKmk8TUFYTjtpKz0yKQogICAgewogICAgICAgIGlmKHByaW1lW2ldID09IGZhbHNlKXsKICAgICAgICAgICAgIGZvcihsbCBqPWkqaTtqPE1BWE47ais9IDIqaSkKICAgICAgICAgICAgICAgIHByaW1lW2pdID0gdHJ1ZTsKICAgICAgICB9CiAgICB9CiAgICBmb3IoaW50IGk9MztpPE1BWE47aSs9IDIpIGlmKHByaW1lW2ldID09IGZhbHNlKSB2LnBiKGkpOwp9CnZvaWQgc29sdmUoKQp7CiAgIGxsIG47CiAgIGNpbiA+PiBuOwogICBsbCBhbiA9MTsKCiAgIGZvcihsbCBpID0gMDtpIDwgdi5zaXplKCkgJiYgdltpXSp2W2ldIDw9IG47aSsrKQogICB7CiAgICAgIGlmKG4ldltpXSA9PSAwKQogICAgICB7CiAgICAgICAgbGwgYSA9IDA7CiAgICAgICAgd2hpbGUobiV2W2ldID09IDApCiAgICAgICAgewogICAgICAgICAgICAgIG4gIC89IHZbaV07CiAgICAgICAgICAgICAgYSsrOwogICAgICAgIH0KCiAgICAgICAvLyBjb3V0PDxpPDwiICI8PGE8PGVuZGw7CiAgICAgICAgYW4gKj0gKCggMkxMKmEpICsgMUxMKTsKICAgICAgfQogICB9CiAgIAogICBpZihuICE9IDEpCiAgIHsKICAgICBhbiAqPSAzTEw7CiAgIH0KICAgY291dDw8KGFuICsgMUxMKS8yTEw8PGVuZGw7CiAgIC8vY291dDw8YW48PGVuZGw7Cn0KaW50IG1haW4oKQp7CiAgICBJT1M7CiAgICBsbCB0OwogICAgLy90ID0gMTsKICAgIGNpbiA+PiB0OwoKICAgIHNpZXZlKCk7CiAgIAogICAgaW50IGMgPSAwOwogICAgd2hpbGUgKCB0LS0gKQogICAgewogICAgICAgIGNvdXQ8PCJDYXNlICI8PCsrYzw8IjogIjsKICAgICAgICBzb2x2ZSgpOwogICAgfQogICAgcmV0dXJuIDA7Cn0KICAgLy8vIEEgTCBIIEEgTSBEIFUgTCBJIEwgTCBBIEgK