# めぐるちゃんのを参考にしました 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): dikj = dist[i][k] + dist[k][j] if dist[i][j] > dikj: dist[i][j] = dikj dp = [[inf] * (K + 1) for _ in range(1 << (K + 1))] def check(v): l = len(v) l1 = 1 << l for i in range(l1): for j in range(l): dp[i][j] = inf d0 = dist[0] for i in range(l): dp[1 << i][i] = d0[v[i]] for i in range(1, l1): dpi = dp[i] for j in range(l): dpij = dpi[j] if dpij == inf: continue distj = dist[v[j]] for k in range(l): k1 = 1 << k if i & k1: continue nd = dp[i + k1] nv = dpij + distj[v[k]] if nv < nd[k]: nd[k] = nv return any(a <= K for a in dp[(l1) - 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()