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.product(range(N),repeat=4))) ABCD = ABCD[G[ABCD[:,0], ABCD[:,1]]] ABCD = ABCD[G[ABCD[:,1], ABCD[:,2]]] ABCD = ABCD[G[ABCD[:,2], ABCD[:,3]]] ABCD = ABCD[G[ABCD[:,3], ABCD[:,0]]] ABCD = ABCD[~G[ABCD[:,0], ABCD[:,2]]] ABCD = ABCD[~G[ABCD[:,1], ABCD[:,3]]] ABCD = ABCD[ABCD[:,0] != ABCD[:,2]] ABCD = ABCD[ABCD[:,1] != ABCD[:,3]] answer = len(ABCD) // 8 print(answer)