#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  ++n;
  long long ans = 0;
  for (int a = m + 1; 2 * a <= n; ++a) {
    long long cur = 0;
    int c = n - m - 1;
    for (int b = m + 1; b < n - m && c > m; ++b) {
      while (c > m && -b * (n + c) <= 2 * a * a - a * b - 2 * n * a + c * a)
        --c;
      cur += c - m;
    }
    ans += cur;
    if (a + a != n) ans += cur;
  }
  printf("%I64d\n", 3 * ans);
  return 0;
}
