#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, mi, sum;
  long long ans = 0;
  scanf("%lld%lld", &n, &m);
  for (long long x = m + 1; x <= (n + 1 >> 1); x++) {
    sum = 0;
    for (long long y = m + 1; y < (x << 1); y++) {
      mi = (x * (2 * x - y) + (n + 1) * (2 * y - x)) / (x + y);
      mi = max(mi, m);
      if (mi > n - m) continue;
      mi = n - m - mi;
      sum += mi;
      ans += mi << 1;
    }
  }
  if (n & 1) ans -= sum;
  printf("%lld\n", ans * 3);
  return 0;
}
