#include <bits/stdc++.h>
using namespace std;
int main() {
  int city_point, capcity;
  cin >> city_point >> capcity;
  if (city_point - 1 <= capcity)
    cout << city_point - 1;
  else {
    cout << capcity - 1 +
                (1 + city_point - capcity) * (city_point - capcity) / 2;
  }
  return 0;
}
