#include <bits/stdc++.h>
using namespace std;
int n, m;
int cnt[1000010];
long long c[1000010][4];
int main() {
  c[0][0] = 1;
  for (int i = 1; i <= 1000000; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= 3; j++) c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
  }
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    cnt[a - 1]++;
    cnt[b - 1]++;
  }
  long long tmp = 0;
  for (int i = 0; i < n; i++) {
    tmp += 1LL * cnt[i] * (n - 1 - cnt[i]);
  }
  cout << c[n][3] - tmp / 2;
  return 0;
}
