#include <iostream>
using namespace std;
int main()
{int i,j;
long long mul;
bool stop=false;
do{cin>>i;
if(i>0 && i<=20){mul=1;
for (j=i;j>1;j--){mul*=j;}
cout<<mul<<endl;}
else if (i==0)cout<<"1"<<endl;
else if (i<0)
cout<<"Error."<<endl;
}while(stop==false);

return 0;}