N,M=map(int,input().split()) B=[set() for _ in range(N+1)] for _ in range(M): a,b=map(int,input().split()) B[a].add(b) B[b].add(a) K=0 for i in range(1,N+1): for j in range(i+1,N+1): for k in range(j+1,N+1): F=True F&=(B[i] & B[j]==set()) or (j in B[i]) F&=(B[j] & B[k]==set()) or (k in B[j]) F&=(B[k] & B[i]==set()) or (i in B[k]) K+=F print(K)