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