#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    long long int n, v, ans = 0;
    cin >> n >> v;
    if (v >= n - 1) {
      cout << n - 1 << "\n";
      return 0;
    }
    if (v == 1) {
      n--;
      cout << n * (n + 1) / 2 << "\n";
      return 0;
    }
    ans = v;
    for (long long int i = 2; i <= n - v; i++) ans += i;
    cout << ans << "\n";
  }
  return 0;
}
