from collections import deque N,M = map(int,input().split()) G = {i:set() for i in range(N)} for _ in range(M): a,b = map(int,input().split()) G[a].add(b) G[b].add(a) ans = 0 for i in range(N-3): for j in range(i+1,N-2): for k in range(j+1,N-1): for l in range(k+1,N): if len(G[i]&set([j,k,l]))==2 and len(G[j]&set([i,k,l]))==2 and len(G[k]&set([i,j,l]))==2 and len(G[l]&set([i,j,k]))==2: col = {i:1,j:0,k:0,l:0} que = deque([i]) while que: x = que.popleft() A = set([i,j,k,l]) A.remove(x) for y in G[x]&A: if col[y]==0: col[y] = 1 que.append(y) if sum(col.values())==4: ans += 1 else:continue print(ans)