#include <iostream>
#include <cstring>
using namespace std;
const int MAXN = 100000;
bool isPrime[MAXN];
int prime[MAXN]; //存储小于10^5的素数
int main()
{
memset(isPrime, true, sizeof(isPrime));
int num = 0;
for (int i = 2; i * i <= MAXN; i++)
{
if (isPrime[i])
prime[num++] = i;
for (int j = i * i; j < MAXN; j += i)
isPrime[j] = false;
}
int T;
cin >> T;
for (int Case = 1; Case <= T; Case++)
{
int n;
cin >> n;
int tmpN = n;
int temp;
int ans = 1;
for (int i = 0; i < num && prime[i] * prime[i] <= n; i++)
{
temp = 0;
while (tmpN % prime[i] == 0) //计算因子prime[i]的指数
{
++temp;
tmpN /= prime[i];
}
ans *= (2 * temp + 1);
}
if (tmpN > 1)
ans *= 3;
cout << "Scenario #" << Case << ":" << endl;
cout << (ans + 1) / 2 << endl << endl;
}
}