#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, v, cost = 0;
  cin >> n >> v;
  n--;
  cost = v;
  if (v == n)
    cout << cost;
  else if (v > n)
    cout << n;
  else {
    for (int i = 0; i < n - v; i++) {
      cost += i + 2;
    }
    cout << cost;
  }
  return 0;
}
