# coding: utf-8 # Your code here! def saiki(num,origin): group[num]=origin for i in range(len(friends[num])): if friends[num][i]==1 and group[i]==i: saiki(i,origin) return N,M=map(int,input().split()) friends=[[0 for i in range(N)] for j in range(N)] group=[i for i in range(N)] for _ in range(M): a,b=map(int,input().split()) a-=1 b-=1 friends[a][b]=1 friends[b][a]=1 for i in range(N): if group[i]==i: saiki(i,i) ans=0 for i in range(N-2): for j in range(i+1,N-1): for k in range(j+1,N): if (friends[i][j]==1 or group[i]!=group[j]) and (friends[j][k]==1 or group[j]!=group[k]) and (friends[k][i]==1 or group[k]!=group[i]): ans+=1 print(ans)