#include <stdio.h>
  /*
    AOJ 1060
    Title:No Story
    @kankichi573
   */
void soinsuu_bunkai(long long n,int primes[],int *shurui)
{
  int i,shu; 

  shu=0;
  if((n % 2)==0)
    {
      shu=1;
      primes[0]=1;
      n /= 2;
      while((n % 2)==0)
	{
	  primes[0]++;
	  n /= 2;
	}
    }
  for(i=3;i*i<=n;i+=2)
    {
      if((n % i)==0)
	{
	  primes[shu]=1;
	  n /= i;
	  while((n % i)==0)
	    {
	      primes[shu]++;
	      n /= i;
	    }
	  shu++;
	}
    }
  if(n>1)
    {
      primes[shu]=1;
      shu++;
    }
  *shurui=shu;
}


int ways(int bit_pattern,int pr[],int n)
{
  int ret,i,pat;

  ret=1;
  for(i=0,pat=1;i<n;i++,pat <<=1)
    {
      if(!(bit_pattern & pat))
	ret *= pr[i];
    }
  return(ret);
}
/*
  exmaple 
  arg=1,1   => 5
  arg=1,1,1 => 14
  arg=1,1,2 => 23
  arg=1,1,1,1 => 41
 */
int solve(int pr[],int n)
{
  int myarray[100],i,j,ret;
  int fullbit;
  // soinsuubunkai no kekka kara
  // bekijou no jouhou dake kiridasu
  fullbit=(1<<n)-1;

  ret=0;
  for(i=fullbit;i>0;i--)
    for(j=0;j<=i;j++)
      {
	if((i | j) == fullbit)
	  {
	    ret += ways(i,pr,n)*ways(j,pr,n);
	  }
      }
  return(ret);
}

main()
{
  long long n,i;
  int primes[100];
  int shurui,ret;

  while(scanf("%lld",&n) && n)
  {
    for(i=0;i<100;i++)
      primes[i]=0;
    soinsuu_bunkai(n,primes,&shurui);

    ret=solve(primes,shurui);
    printf("%d\n",ret);
  }
  return(0);
}