#include <bits/stdc++.h>
using namespace std;
const long long int LL_MAX = 1e18 + 5;
const int MX = INT_MAX;
const long long int mod = 1000000007;
const int maxx = 2e5;
const int d4i[4] = {-1, 0, 1, 0};
const int d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};
bool rev(int a, int b) { return a >= b; }
long long int fac[1000001];
void factorial() {
  long long int MOD = 1e9 + 7;
  fac[0] = 1;
  for (long long int i = 1; i < 1000001; i++)
    fac[i] = (fac[i - 1] % MOD * (i % MOD)) % MOD;
}
string yes = "YES", no = "NO";
void solve() {
  int n, v;
  cin >> n >> v;
  ;
  long long int ans = 0;
  if (v >= n - 1) {
    cout << n - 1 << "\n";
    return;
  }
  ans = v;
  for (int i = 1; i < n; i++) {
    if (i + v < n)
      ans += (i + 1);
    else
      break;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  solve();
  return 0;
}
