import sys from collections import deque read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, M, K = map(int, readline().split()) m = map(int, read().split()) G = [[] for _ in range(N)] for u, v in zip(m, m): u -= 1 v -= 1 G[u].append(v) G[v].append(u) def bfs(v): dist = [-1] * N q = deque([v]) dist[v] = 0 while q: v = q.popleft() for w in G[v]: if dist[w] != -1: continue dist[w] = dist[v] + 1 q.append(w) return dist dist_mat = [bfs(v) for v in range(N)] def extract_subgraph(A): assert A[0] == 0 mat = [] for i in A: mat.append([dist_mat[i][j] for j in A]) return mat def min_hamilton_path(A): mat = extract_subgraph(A) n = len(A) INF = K + 1 dp = [[INF] * n for _ in range(1 << n)] # (部分集合, 最後の頂点) dp[1][0] = 0 for s in range(1, 1 << n, 2): for i in range(n): x = dp[s][i] if x == INF: continue for j in range(1, n): if s & (1 << j): continue t = s ^ (1 << j) y = x + mat[i][j] if dp[t][j] > y: dp[t][j] = y return min(dp[-1]) A = [0] for n in range(N - 1, 0, -1): A.append(n) if min_hamilton_path(A) > K: A.pop() answer = sum((1 << x) - 1 for x in A) print(answer)