#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, v;
  cin >> n >> v;
  int req = n - 1, cost = v, pos = 2, left = v - 1;
  if (v >= n - 1)
    cost = n - 1;
  else {
    while (left < n - pos) {
      cost += pos;
      left = v - 1;
      pos++;
    }
  }
  cout << cost;
  return 0;
}
