#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;

vector<vector<int> > g;
vector<int> used;
int cycle;

void dfs(int v)
{
	used[v] = 1;
	if (cycle) return;
	for (int i = 0; i < g[v].size(); i++)
	{
		if (used[g[v][i]] == 0) dfs(g[v][i]);
		if (used[g[v][i]] == 1)
		{
			cycle = 1;
			return;
		}
		if (cycle) return;
	}
	used[v] = 2;
}

int main()
{
	freopen("baskerville.in", "r", stdin);
	freopen("baskerville.out", "w", stdout);
	int n;
	cin >> n;
	vector<pair<int, int> > edge;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < n; j++)
			if (i !=j) edge.push_back(make_pair(i, j));

	int olo = n * (n - 1);
	int ans = 0;
	for (long long mask = 0; mask < (1LL << olo); mask++)
	{
		cycle = 0;
		g.clear();
		g.resize(n);
		used.assign(n, 0);
		for (int i = 0; i < olo; i++)
			if ((mask >> i) & 1) g[edge[i].first].push_back(edge[i].second);
		for (int i = 0; i < n; i++)
			if (used[i] == 0)
			{
				dfs(i);
				if (cycle) break;
			}
		if (!cycle) ans++;
	}
	cout << ans;
}