#include <bits/stdc++.h>
using namespace std;
long long rdtsc() {
  long long tmp;
  asm("rdtsc" : "=A"(tmp));
  return tmp;
}
inline int myrand() { return abs((rand() << 15) ^ rand()); }
inline int rnd(int x) { return myrand() % x; }
bool solve() {
  int n, m;
  if (scanf("%d%d", &n, &m) < 2) return 0;
  long long ans = 0;
  for (int i = m + 1; i <= n - m; ++i) {
    unsigned int k = ((int)1e9);
    int maxj = min(i, (int)((1ll << 32) / (12 * i)));
    for (int j = m + 1; j <= maxj; ++j) {
      unsigned int value = 2 * (n + 1) - i - j;
      k = min(k, value);
      value *= value;
      unsigned int del = 12u * i * j;
      if (value < del) break;
      value -= del;
      while (k * k > value) --k;
      int eq = (k * k == value);
      int midZ = 2 * (n + 1) + i - j;
      int l = max(m + 1, (midZ - (int)k + eq + 3) >> 2);
      int r = min(n - m, (midZ + (int)k - eq) >> 2);
      int tmp = r - l + 1;
      if (tmp > 0) ans += tmp * ((i != j) + 1);
    }
  }
  printf(
      "%lld"
      "\n",
      ans * 3);
  return 1;
}
int main() {
  srand(rdtsc());
  while (1) {
    if (!solve()) break;
  }
  return 0;
}
