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