n,m=map(int,input().split()) g=[[n*2]*n for _ in range(n)] for _ in range(m): a=list(map(int,input().split())) g[a[0]-1][a[1]-1]=1 g[a[1]-1][a[0]-1]=1 for k in range(n): for i in range(n): for j in range(n): g[i][j]=min(g[i][j],g[i][k]+g[k][j]) ans=set() for i in range(n): for j in range(i+1,n): if g[i][j]!=2: for k in range(j+1,n): if g[j][k]!=2 and g[k][i]!=2 and k!=i: a=sorted([i+1,j+1,k+1]) ans.add(a[0]*100+a[1]*10+a[2]) ans=list(ans) print(len(ans))