#include <bits/stdc++.h>
using namespace std;
int T(int n, int r) {
  int min = 0, max = 0;
  min = (0 + (r - 1)) * r / 2;
  max = (n + (n - (r - 1))) * r / 2;
  int ret = max - min + 1;
  return ret;
}
int main() {
  int n, k;
  cin >> n >> k;
  int d = 0;
  for (int i = k; i <= n + 1; i++) {
    d += T(n, i);
  }
  cout << d << endl;
  return 0;
}
