#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, v, i, sum;
  cin >> n >> v;
  if (n - 1 <= v)
    cout << n - 1;
  else {
    sum = v;
    for (i = 1; i < n - v; i++) sum += i + 1;
    cout << sum;
  }
}
