from itertools import * N, M = map(int, input().split()) adj_mat = [[0]*N for _ in range(N)] for _ in range(M): ai, bi = map(int, input().split()) adj_mat[ai-1][bi-1] = 1 adj_mat[bi-1][ai-1] = 1 ans = 0 for c in combinations(range(N), 4): for p in permutations(c): a, b, c, d = p[0], p[1], p[2], p[3] if adj_mat[a][b]==1 and adj_mat[b][c]==1 and adj_mat[c][d]==1 and adj_mat[d][a]==1 and adj_mat[a][c]==0 and adj_mat[b][d]==0: ans += 1 break print(ans)