#include<stdio.h>
long long int numbers[21];
int last_added=1;

long long int facto(int key)
{
	long long int m = 1;
	
	if (numbers[key] != 0)
		return numbers[key];
	
	else
	{
		for (int i = last_added; i <= key; i++)
		{
			if (numbers[i] != 0)
			{
				m *= numbers[i];
			}
			else
			{
				m *= i;
				numbers[i] = m;
				if (i > last_added)
					last_added = i;
			}
		}
		return m;
	}
}
int main()
{
	int n;
	while (scanf("%d", &n))
	{
		printf("%lld\n", facto(n));
	}
	return 0;
}