#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int64_t n, v;
  cin >> n >> v;
  if (v >= n) {
    cout << (n - 1);
    return 0;
  }
  int64_t x = (n - v);
  int64_t sum = (x * (x + 1)) / 2 - 1;
  cout << sum + v;
  return 0;
}
