from itertools import permutations from itertools import combinations def solve(): n, m = map(int, input().split()) if n < 4: return 0 node = [[0] * n for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) node[a][b] = node[b][a] = 1 ans = set() for a, b, c, d in combinations(range(n), 4): if all(node[w][x] + node[w][y] + node[w][z] == 2 for w, x, y, z in permutations((a, b, c, d), 4)): ans.add(frozenset([a, b, c, d])) return len(ans) print(solve())