#include <iostream>
#include <vector>
#include <algorithm>
#include <memory.h>
#include <assert.h>

using namespace std;

int N, M, graph[1001][1001];
int main() {
	scanf("%d", &N);
	scanf("%d", &M);
	while (M--) {
		int u, v;
		scanf("%d %d", &u, &v);
		graph[u][v] = graph[v][u] = 1;
	}
	long long diffColor = 0;
	for (int i = 1; i <= N; i++) {
		int blackCount = 0, redCount = 0;
		for (int j = 1; j <= N; j++) {
			if (i != j) {
				blackCount += !graph[i][j];
				redCount += graph[i][j];
			}
		}
		diffColor += blackCount * redCount;
	}
	assert(diffColor % 2 == 0);
	long long sameColor = (long long)N * (N - 1) * (N - 2) / 6 - diffColor / 2;
	printf("%lld\n", sameColor);
	return 0;
}
