#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long int;
using ld = long double;
using ll = signed long long int;
const int MX = 200;
int n, v, t, res;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(nullptr);
  cin.tie(nullptr);
  cout << fixed;
  cout.precision(12);
  cin >> n >> v;
  t = 0;
  for (int i = 1; i <= n; i++) {
    if (t < n - i) {
      if (t + (n - i) > v) {
        res += (v - t) * i;
        t = v;
      } else {
        res += (n - i) * i;
        break;
      }
    } else {
      break;
    }
    t--;
  }
  cout << res;
}
