#include <stdio.h>
#include<iostream>
using namespace std;

int s, n, all, d, e;

int main () {
  cin >> n;
  while( cin >> n ){
    all = 1;
    for( d=2; d<=n/d; d++ ){
      e = 0;
      while( n%d == 0 ){
	n /= d;
	e++;
      }
      all *= 2*e + 1;
    }
    if( n > 1 )
      all *= 3;
    printf( "Scenario #%d:\n%d\n\n", ++s, all/2 + 1 );
  }
}
