#include <bits/stdc++.h>
int n, m;
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  ++n;
  ++m;
  for (int i = m; i <= (n >> 1); ++i) {
    int d = (i * 2 == n) ? 1 : 2;
    for (int j = m, k = n - m; j <= n - m; ++j) {
      for (; k >= m && (i * 2 - j) * ((i - n) * 2 + k) + 3 * j * k >= 0; --k)
        ;
      if (k < m) break;
      ans += (k - m + 1) * d;
    }
  }
  printf("%I64d\n", ans * 3);
  return 0;
}
