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