#include <stdio.h>
long fun(int n);
int main()
{
int m;
scanf("%d", &m);
printf("The result is %ld\n", fun(m));
return 0;
}
long fun(int n)
{
int i,result=1;
int num=2;
while(num<n)
{
for(i=2;i<num;i++)
{
if(num%i==0)
{
break;
}
}
if(num==i)
{
result*=num;
}
num++;
}
return result;
}