#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;

int main(){
	int n;
	
	while(cin >> n){
		int a[N] = {0};
		a[0] = 1;
		int carry = 0;
		int len = 1;
		int temp = 0;
		for(int i = 1;i <= n;i ++){
			temp = 0;
			for(int j = 0;j < len;j ++){
				temp = carry + i * a[j];
				a[j] = temp % 10;
				carry = temp / 10;
			}
			while(carry){
				a[len ++] = carry % 10;
				carry /= 10;
			}
		}
		for(int i = len - 1;i >= 0;i --){
			cout << a[i];
		}
		cout << endl;
	}
	return 0;
}