#include <bits/stdc++.h>
using namespace std;
long long ans, Ans[32005] = {0};
int t1;
int R;
int main() {
  int n, m, i, j, k, l, L;
  scanf("%d%d", &n, &m);
  L = n + 1;
  for (i = m + 1; i <= n - m; i++) {
    if (i * 2 > L) {
      Ans[i] = Ans[L - i];
      continue;
    }
    t1 = 2 * (i * (L - i)) - ((m + 1) * (L - i) + 1);
    k = L - i;
    int Down = m + 1 + i, Up = n - m + i;
    for (j = Down; j <= Up; j++, t1 -= k) {
      R = (t1) / (j);
      if (R <= m) break;
      R = (R > n - m ? n - m : R);
      Ans[i] += (R - m);
    }
  }
  for (i = m + 1; i <= n - m; i++) ans += Ans[i];
  ans *= 3;
  printf("%I64d\n", ans);
  return 0;
}
