#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, v;
  cin >> n >> v;
  int dis = n - 1;
  if (dis <= v) {
    cout << dis << endl;
    return;
  }
  int lagbe = dis - v;
  int j = 2;
  int sum = v;
  for (int i = 0; i < lagbe; i++) {
    sum += j;
    j++;
  }
  cout << sum << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
  return 0;
}
