#include <bits/stdc++.h>
using namespace std;
int n, m, x, y, a[50000000], two, tri;
long long int answer, ans, q1, q2, q3;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    answer -= a[x] * (n - 1 - a[x]);
    answer -= a[y] * (n - 1 - a[y]);
    a[x]++;
    a[y]++;
    answer += a[x] * (n - 1 - a[x]);
    answer += a[y] * (n - 1 - a[y]);
  }
  if (n < 3) {
    cout << "0";
    return 0;
  }
  q1 = n;
  q2 = n - 1;
  q3 = n - 2;
  if (q1 % 2 == 0 && two == 0) {
    two = 1;
    q1 /= 2;
  }
  if (q2 % 2 == 0 && two == 0) {
    two = 1;
    q2 /= 2;
  }
  if (q3 % 2 == 0 && two == 0) {
    two = 1;
    q3 /= 2;
  }
  if (q1 % 3 == 0 && tri == 0) {
    tri = 1;
    q1 /= 3;
  }
  if (q2 % 3 == 0 && tri == 0) {
    tri = 1;
    q2 /= 3;
  }
  if (q3 % 3 == 0 && tri == 0) {
    tri = 1;
    q3 /= 3;
  }
  ans = q1 * q2 * q3;
  answer /= 2;
  cout << ans - answer;
  return 0;
}
