#include <bits/stdc++.h>
using namespace std;
inline int Get() {
  int res = 0, q = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') q = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return res * q;
}
const double eps = 1e-5, pi = M_PI;
const int oo = (int)2e9, mod = (int)1e9 + 7;
const long long INF = (long long)1e17;
int n, m, gt, ed;
long long ans;
bool Obtuse(int x, int y, int z) {
  int ck = 2 * x * (2 * n + 2 - z - y);
  ck += y * (4 * y - 2 * n - 2 - 2 * z);
  return ck < 0;
}
int main() {
  scanf(
      "%d"
      "%d"
      "\n",
      &n, &m),
      ed = 2 * n;
  if (n & 1) gt = (n + 1) >> 1;
  for (int i = (m + 1), end = ((n + 1) >> 1); i <= end; ++i) {
    int cnt = m + 1;
    long long ad = 0;
    for (int j = (n + n - m), end = (n + m + 1); j >= end; --j) {
      for (; cnt <= ed && Obtuse(cnt, i, ed - j + 1); ++cnt)
        ;
      ad += (long long)(cnt - m - 1);
    }
    if (i != gt)
      ans += (ad << 1);
    else
      ans += ad;
  }
  printf(
      "%I64d"
      "\n",
      ans * 3);
  return 0;
}
