#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
int d[MAXN];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    d[a]++;
    d[b]++;
  }
  long long ans = 0;
  long long c = n;
  ans = c * (c - 1) * (c - 2) / 6;
  long long del = 0;
  for (int i = 1; i <= n; i++) {
    long long l = d[i];
    long long r = c - 1 - d[i];
    long long mis = (c - 1) * (c - 2) / 2 - l * (l - 1) / 2 - r * (r - 1) / 2;
    del += mis;
  }
  cout << ans - del / 2 << endl;
  return 0;
}
