#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 2, j, k = 1, v, c = 0;
  cin >> n >> v;
  c = (v <= n - 1) ? v : n - 1;
  j = c;
  while (j < n - 1) {
    j++;
    c += i;
    i++;
  }
  cout << c;
  return 0;
}
