#include <bits/stdc++.h>
int n, m;
int main() {
  long long ans;
  int b, c, A, B, C, l;
  scanf("%d%d", &n, &m);
  n++;
  m++;
  ans = 0;
  for (c = m; c <= n / 2; c++) {
    C = 2 * (n * n - n * c + c * c);
    A = 2 * n - c;
    for (b = n - m; b >= m; b--) {
      B = b * (n + c);
      l = (C - B) / (A - b);
      if (m > l) l = m - 1;
      if (l >= n - m) break;
      ans += n - m - l;
      if (c * 2 < n) ans += n - m - l;
    }
  }
  printf("%I64d\n", ans * 3);
  return 0;
}
