import sys from itertools import combinations def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None def solve(): N, M = map(int, input().split()) Adj = [[0]*N for i in range(N)] cnt = 0 for lp in range(M): a, b = map(int, input().split()) Adj[a][b] = 1 Adj[b][a] = 1 for comb in combinations(range(N), 4): for u in comb: deg = 0 for v in comb: deg += Adj[u][v] if deg != 2: break else: cnt += 1 print(cnt) if __name__ == '__main__': solve()