import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines import numpy as np import itertools N,M = map(int,readline().split()) m = map(int,read().split()) AB = zip(m,m) G = np.zeros((N,N),np.bool_) for a,b in AB: G[a,b] = 1 G[b,a] = 1 ABCD = np.array(list(itertools.combinations(range(N),4))) if ABCD.shape[0] == 0: print(0) exit() def deg(i): d = np.zeros(ABCD.shape[0],np.int32) for j in range(4): if i == j: continue d += G[ABCD[:,i], ABCD[:,j]] return d is_ok = np.ones(ABCD.shape[0],np.bool_) for i in range(4): is_ok &= deg(i) == 2 answer = np.count_nonzero(is_ok) print(answer)