#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  int step = n - m - 1;
  int ans = 0;
  while (step > 0) {
    ans += step;
    step = step - 2;
  }
  if (m == 0) {
    ans = ans + 1;
    cout << ans;
  } else {
    cout << ans;
  }
  return 0;
}
