#include <bits/stdc++.h>
using namespace std;
int n, v, f[105][105];
int solve(int n1, int v1) {
  if (n1 > n) return 0;
  if (v1 < 0) return 1000000007;
  if (f[n1][v1] != -1) return f[n1][v1];
  int res = 1000000007;
  for (int i = 0; i <= v - v1; ++i) {
    res = min(res, solve(n1 + 1, v1 - 1 + i) + n1 * i);
  }
  return f[n1][v1] = res;
}
int main() {
  scanf("%d %d", &n, &v);
  for (int i = 0; i <= n; ++i)
    for (int j = 0; j <= v; ++j) f[i][j] = -1;
  cout << solve(1, 0);
  return 0;
}
