#include <iostream>

using namespace std;

void solve()
{
	int n;
	cin >> n;
	unsigned long long int ans = 1;
	for(int i = 1; i < n; ++i)
	{
		ans *= i;
	}
	cout << ans << endl;
}

int main()
{
	solve();
	return(0);
}