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