import itertools N, M = map(int, input().split()) G = [set() for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) G[a].add(b) G[b].add(a) ans = 0 for t in itertools.combinations(range(N), 4): st = set(t) if all(len(G[x] & st) == 2 for x in t): ans += 1 print(ans)