from itertools import combinations N, M = map(int, input().split()) edges = [set() for _ in [0]*N] for x, y in (map(int, input().split()) for _ in [0]*M): edges[x].add(y) edges[y].add(x) result = 0 for l in combinations(range(N), 4): for i, n in enumerate(l): if len(edges[n].intersection(l[:i]+l[i+1:])) != 2: break else: result += 1 print(result)