#include <bits/stdc++.h>
using namespace std;
bool isPrime(int n) {
  if (n <= 1) return false;
  for (int i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
const int N = 1e5 + 7;
long long l, tr, n, m, sum, mini, maxi, a, b, c, x, y, z;
long long t[N];
set<int> vis;
vector<int> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> x;
  a = 1;
  sum = min(x, n - a);
  m = sum;
  while (sum < n - a) {
    a++;
    m += a;
  }
  cout << m;
}
