#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, v, cost = 0;
  cin >> n >> v;
  if (v >= (n - 1)) {
    cout << (n - 1) << "\n";
  } else {
    cost = v;
    for (long long i = 2; i <= n - v; i++) {
      cost += i;
    }
    cout << cost << "\n";
  }
  return 0;
}
