# めぐるちゃんのを参考にしました import itertools def solve(): N, M, K = map(int, input().split()) inf = float('inf') dist = [[inf] * N for _ in range(N)] for i in range(N): dist[i][i] = 0 for i in range(M): u, v = map(int, input().split()) u -= 1 v -= 1 dist[u][v] = dist[v][u] = 1 for k, i, j in itertools.product(range(N), repeat=3): dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]) dp = [[inf] * (K + 1) for _ in range(1 << (K + 1))] def check(v): l = len(v) for i in range(1 << l): for j in range(l): dp[i][j] = inf for i in range(l): dp[1 << i][i] = dist[0][v[i]] for i in range(1, 1 << l): dpi = dp[i] for j in range(l): if dpi[j] == inf: continue for k in range(l): k1 = 1 << k if i & k1: continue ni = i | k1 dp[ni][k] = min(dp[ni][k], dpi[j] + dist[v[j]][v[k]]) return any(a <= K for a in dp[(1 << l) - 1]) ans = 0 v = [] for n in range(N - 1, 0, -1): if len(v) == K: break v.append(n) if check(v): ans += 2 ** n - 1 else: v.pop() print(ans) if __name__ == '__main__': solve()