N,M=map(int,input().split()) D=[[int(i==j)*2 for i in range(N)]for j in range(N)] for _ in range(M):a,b=map(int,input().split());D[a][b]=D[b][a]=1 G={} for x in D: G[x.index(2)]=[i for i in range(N) if x[i]==1] a=0 for k,v in G.items(): for i in range(len(v)): for j in range(i+1,len(v)): if D[v[i]][v[j]]==1:continue for c in set(G[v[i]])&set(G[v[j]]):a+=(k!=c and k not in G[c]) print(a//4)