import itertools X=list() Y=list() N,M=map(int,input().split()) L=[[] for j in range(N)] R=[[] for j in range(N)] for i in range(M): x,y=map(int,input().split()) L[x-1].append(y) L[y-1].append(x) for i in range(N): for j in range(len(L[i])): R[i].extend(L[L[i][j]-1]) R[i]=[l for l in R[i] if l not in L[i]] R=[list(set(i)) for i in R] ans=0 p_list = list(itertools.combinations(range(1,N+1), 3)) for i in range(len(p_list)): a,b,c=p_list[i] if b not in R[a-1] and c not in R[a-1] and b not in R[c-1]: ans+=1 print(ans)