n, m = [ int(v) for v in input().split() ] link_list = [[] for i in range(n)] link_list2 = [] for i in range(m): x, y = [ int(v) for v in input().split() ] link_list[x].append(y) link_list[y].append(x) link_list2.append([x,y]) def connect(length): if length == 1: outlist = [ [i] for i in range(n) ] return outlist else: templist = connect(length-1) outlist = [] for i in range(len(templist)): k = templist[i][-1] templist2 = [ (templist[i] + [link_list[k][j]] ) for j in range(len(link_list[k])) ] outlist += templist2 return outlist anslist = [] anslist2 = [] for i in connect(5): if len(set(i)) == 4 and i[0] == i[4]: anslist.append(i) for i in anslist: if [i[0], i[2]] not in link_list2 and [i[1], i[3]] not in link_list2: if [i[2], i[0]] not in link_list2 and [i[3], i[1]] not in link_list2: if sorted(set(i)) not in anslist2: anslist2.append(sorted(set(i))) print(len(anslist2))