#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>

typedef long long int ll;


using namespace std;

vector<ll> num(10010,0);
vector<int> flag(10010,0);

ll f(int n){
	if(!flag[n]){
		if(n<2)num[n]=1;
		else num[n]=n*f(n-1);
		flag[n]=1;
	}
	return num[n];
}

int main(){
	int a;
	while(cin>>a){
		cout<<f(a)+1<<endl;
	}
}