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