import sequtils,strutils,math var N,M,K,u,v : int D : array[1..60, array[1..60, int]] (N, M, K) = stdin.readline.split.map(parseInt) for i in 1..N: for j in 1..N: D[i][j] = 200 for m in 1..M: (u,v) = stdin.readline.split.map(parseInt) D[u][v] = 1 D[v][u] = 1 for k in 1..N: for i in 1..N: for j in 1..N: D[i][j] = min(D[i][j], D[i][k] + D[k][j]) var p : int tezyun = newSeqWith(1, 1) x : int DP : array[(1 shl 20) + 1,array[17,int]] for n in countdown(N, 1): if D[1][n] > K: continue tezyun.add(n) for i in 1..(1 shl tezyun.high): for j in 0..tezyun.high: DP[i * 2 - 1][j] = 10000 DP[1][0] = 0 var k = 1 while k < (1 shl tezyun.len): for p in 0..tezyun.high: if DP[k][p] > K: continue for t in 1..tezyun.high: if (k and (1 shl t)) == 0: DP[k + (1 shl t)][t] = min(DP[k + (1 shl t)][t], DP[k][p] + D[tezyun[t]][tezyun[p]]) k += 2 var flag = false for p in 1..tezyun.high: if DP[(1 shl tezyun.len) - 1][p] <= K: flag = true break if not flag: discard tezyun.pop() var ans : int64 for t in tezyun: ans += (1.int64 shl (t - 1)) - 1 echo ans