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3 9
9 10
 10 10
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 1
 3 0
 6 6
1 2
2 3
3 1
4 5
5 6
6 4
 10 0
 9 15
1 2
2 3
3 1
1 4
4 5
5 1
1 6
6 7
7 1
1 8
8 9
9 1
2 9
7 4
2 8
 4 0
 1 0

1
 0
 43
 0
 8
 0
 84
 82
 63
 166666166667000000
 21
 30
 292
 64
 36
 0
 84
 284
 1
 37
 1
 4
 59
 50
 1
 2
 120
 28
 4
 0

#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int size(const T &c) {
  return c.size();
}
template <class T>
inline int length(const T &c) {
  return c.length();
}
template <class T>
inline void RP(T &a) {
  cin >> a.first >> a.second;
}
void RI(int &a) { scanf("%d", &a); }
void RI(int &a, int &b) {
  RI(a);
  RI(b);
}
void RI(long long &a) { scanf("%I64d", &a); }
void RI(long long &a, long long &b) {
  RI(a);
  RI(b);
}
void WI(int a) { printf("%d ", a); }
void WI(int a, int b) {
  WI(a);
  WI(b);
}
void WI(long long a) { printf("%I64d ", a); }
void WI(long long a, long long b) {
  WI(a);
  WI(b);
}
pair<int, int> operator+(const pair<int, int> a, const pair<int, int> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
pair<int, int> operator-(const pair<int, int> a, const pair<int, int> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
pair<int, int> operator*(const pair<int, int> a, const int b) {
  return make_pair(a.first * b, a.second * b);
}
pair<int, int> operator/(const pair<int, int> a, const int b) {
  return make_pair(a.first / b, a.second / b);
}
pair<double, double> operator+(const pair<double, double> a,
                               const pair<double, double> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
pair<double, double> operator-(const pair<double, double> a,
                               const pair<double, double> b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
pair<double, double> operator*(const pair<double, double> a, const double b) {
  return make_pair(a.first * b, a.second * b);
}
pair<double, double> operator/(const pair<double, double> a, const double b) {
  return make_pair(a.first / b, a.second / b);
}
const double eps = 1e-8;
double dist(pair<double, double> a, pair<double, double> b) {
  return sqrt(a.first - b.first * a.first - b.first + a.second -
              b.second * a.second - b.second);
}
int fr[1000010];
vector<int> a[1000010];
vector<int> q;
int n, m;
int main() {
  RI(n);
  RI(m);
  for (int i = (1), _b = (m); i <= _b; i++) {
    int u, v;
    RI(u, v);
    a[u].push_back(v);
    a[v].push_back(u);
  }
  memset(fr, 0, sizeof fr);
  int key = 0;
  long long red = 0;
  for (int u = (1), _b = (n); u <= _b; u++) {
    key++;
    q.clear();
    for (int i = (0), _b = ((a[u].size()) - 1); i <= _b; i++) {
      fr[a[u][i]] = key;
      q.push_back(a[u][i]);
    }
    for (int i = (0), _b = ((q.size()) - 1); i <= _b; i++)
      if (q[i] > u) {
        int v = q[i];
        int tmp = n - v;
        for (int j = (0), _b = ((a[v].size()) - 1); j <= _b; j++)
          if (fr[a[v][j]] == key && a[v][j] > v) tmp--;
        red += tmp;
      }
  }
  WI(long long(n) * (n - 1) * (n - 2) / 6 - red);
  return 0;
}
