#include <iostream>
using namespace std;

int main()
{
	int i;
	int 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;
	}
	if (i==0)
		cout<<"1"<<endl;
	}while(stop==false);

	return 0;
}