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