#include <bits/stdc++.h>
using namespace std;
string s;
bool solve(int l, int r) {
  stack<char> st;
  for (int i = l; i <= r; i++) {
    if (s[i] == '(')
      st.push(s[i]);
    else if (s[i] == ')') {
      if (st.empty())
        return false;
      else {
        if (st.top() == '(')
          st.pop();
        else
          return false;
      }
    }
  }
  if (st.empty())
    return true;
  else
    return false;
}
int main() {
  int n, v;
  cin >> n >> v;
  if (n - v <= 1) {
    cout << (n - 1) << endl;
  } else {
    int keep = (n - v);
    int res = ((keep) * (keep + 1)) / 2;
    res += (v - 1);
    cout << res << endl;
  }
  return 0;
}
