#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, v;
  cin >> n >> v;
  if (v >= n - 1) {
    cout << n - 1 << '\n';
    exit(0);
  }
  int ans = v;
  for (int i = 2; i <= n - v; ++i) ans += i;
  cout << ans << '\n';
}
