#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, a, b, ans;
  scanf("%i%i", &n, &m);
  for (int i = 0; i < m; i++) scanf("%i%i", &a, &b);
  n++;
  n /= 2;
  ans = n * (n - 1) / 2;
  printf("%i", ans);
  return 0;
}
