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