#include <bits/stdc++.h>
using namespace std;
void Solution() {
  int n, v, m = 0;
  cin >> n >> v;
  if (n - 1 < v)
    cout << n - 1;
  else {
    int result = v - 1;
    for (int i = 1; i <= n - v; ++i) {
      result += i;
    }
    cout << result;
  }
}
int main() { Solution(); }
