#include <bits/stdc++.h>
using namespace std;
int qmin(int a, int b) { return (a < b) ? a : b; }
int qmax(int a, int b) { return (a > b) ? a : b; }
unsigned int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  long long ans = 0;
  int jl = n + m + 2;
  int jr = n + n + 1 - m;
  for (unsigned int x = m + 1; x <= n - m; x++) {
    for (unsigned int i = m + 1; i <= n - m; i++) {
      int jlmt = (2 * x * x + 3 * (n + 1) * i - i * x) / (i + x);
      if (jlmt >= jr) break;
      ans += jr - qmax(jlmt + 1, jl) + 1;
    }
  }
  cout << ans * 3LL << endl;
  return 0;
}
