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