n,m=map(int,input().split()) d=[[3]*n for _ in range(n)] for i in range(m): a,b=map(int,input().split()) a-=1 b-=1 d[a][b]=1 d[b][a]=1 for m in range(n): for i in range(n): for j in range(n): d[i][j]=min(d[i][j],d[i][m]+d[m][j]) ans=0 for i in range(n): for j in range(i+1,n): for k in range(j+1,n): if d[i][j] !=2 and d[j][k] !=2 and d[i][k] !=2: ans+=1 print(ans)