#include <bits/stdc++.h>
using namespace std;
int n, m;
int L;
int main() {
  scanf("%d%d", &n, &m);
  L = n + 1;
  long long ans = 0;
  for (int a = m + 1; a <= L / 2; a++) {
    int lef = m + 1, rig = min(2 * a - 1, n - m), mid;
    while (lef <= rig) {
      mid = lef + rig >> 1;
      long long t = L - (1ll * (L - a) * (-mid + 2 * a) - 1) / (mid + a);
      if (t <= m + 1)
        lef = mid + 1;
      else
        rig = mid - 1;
    }
    ans += (a * 2 == L ? 1ll : 2ll) * (n - 2 * m) * (lef - m - 1);
    for (int b = lef, t = L - (1ll * (L - a) * (-lef + 2 * a) - 1) / (lef + a);
         b <= 2 * a - 1 && b <= n - m; b++) {
      while (t <= n - m &&
             1ll * (L - t) * (a + b) >= 1ll * (L - a) * (2 * a - b))
        t++;
      if (t <= n - m) {
        ans += (a * 2 == L ? 1ll : 2ll) * (n - m - t + 1);
      } else
        break;
    }
  }
  cout << ans * 3 << endl;
  return 0;
}
