#include<iostream>
int input=0;

int factorial(int n)
{
  return (n == 1 || n == 0) ? 1 : factorial(n - 1) * n;
}

int main()
{
	std::cin>>input;
	do
	{	
		factorial(input);
		std::cin>>input;
	}while(input<=20&&input>=0);


	return 0;
}