#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v, res;
  cin >> n >> v;
  if ((v + 1) >= n)
    cout << n - 1 << endl;
  else {
    res = v;
    for (int i = v + 1, j = 2; i < n; i++, j++) {
      res += j;
    }
    cout << res << endl;
  }
  return 0;
}
