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