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