#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long INF = 1e18;
const int MX = 100001;
const long double PI = 4 * atan((long double)1);
int n, v, result;
void solve() {
  cin >> n >> v;
  if (n - 1 < v)
    cout << n - 1 << "\n";
  else {
    result = v;
    for (int i = 2; i <= n - v; i++) result += i;
    cout << result << "\n";
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  solve();
  return 0;
}
