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