#include<iostream>
using namespace std;
const int N = 100 + 10;
int a[N][N], n, k, m, res;
int f[N];
bool check(int cur, int c)
{
if (f[cur]) return false;
for (int i = 1; i <= n; i++) {
if (a[cur][i] && f[i] == c) return false;
}
return true;
}
void dfs(int cur, int c,int step)
{
if (check(cur, c)) {
f[cur] = c;
if (step == n-1) {
res++;
f[cur] = 0;
return;
}
for (int i = 1; i <= n; i++) {
if (a[cur][i] && f[i] == 0) {
for (int j = 1; j <= m; j++) {
dfs(i, j,step+1);
}
}
}
f[cur] = 0;
}
return;
}
int main()
{
cin >> n >> k >> m;
for (int i = 1; i <= k; i++) {
int x, y;
cin >> x >> y;
a[x][y] = a[y][x] = 1;
}
for (int i = 1; i <= m; i++) {
dfs(1, i,0);
}
cout << res << endl;
return 0;
}