N, M = map(int, input().split()) S = set() G = [[] for i in range(N)] for i in range(M): a, b = map(int, input().split()) a, b = a - 1, b - 1 if (a, b) in S: continue S.add((a, b)) S.add((b, a)) G[a].append(b) G[b].append(a) SS = set() for i in range(N): M = len(G[i]) for x in range(M): for y in range(x + 1, M): a, b = G[i][x], G[i][y] if (a, b) not in S: for k in range(N): if k != a and k != b: SS.add(tuple(sorted([k, a, b]))) print(N * (N - 1) * (N - 2)//6 - len(SS))