N,M=map(int,input().split()) E=set() for i in range(M): a,b=map(int,input().split()) E.add((a,b)) def f(a,b): return (min(a,b),max(a,b)) in E S=0 for x in range(N): for y in range(N): if x!=y: for z in range(N): if x!=z and y!=z: for w in range(N): if x!=w and y!=w and z!=w: S+=(f(x,y) and f(y,z) and f(z,w) and f(w,x) and (not f(x,z)) and (not f(y,w))) print(S//8)