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