#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
void FIO() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
ll gcd(ll a, ll b) {
  if (b == 0)
    return a;
  else {
    return gcd(b, a % b);
  }
}
void tmt(void) {
  int n, v;
  cin >> n >> v;
  int cost = 0;
  if (v > n) {
    cost = n - 1;
    cout << cost << endl;
  } else {
    cost = v;
    int i = 2;
    while (n > v) {
      cost += i;
      i++;
      n--;
    }
    cout << cost - i + 1 << endl;
  }
}
int main() {
  FIO();
  int t;
  tmt();
  return 0;
}
