#include <bits/stdc++.h>
using namespace std;
int n, m;
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  n++;
  m++;
  for (int i = m; i <= n - m; i++) {
    int k = n - m, l = 1ll * 2 * i * i - 2 * i * n - i * m + i + m * n - n +
                       k * (m + i) - k;
    for (int j = n - m; j >= m && k >= m; j--) {
      l += n + k - i;
      while (k >= m && l >= 0) k--, l += j - i - n;
      ans += k - m + 1;
    }
  }
  cout << ans * 3 << endl;
  return 0;
}
