#include <bits/stdc++.h>
using namespace std;
int n, m;
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = m + 1; i <= (n + 1) / 2; i++) {
    for (int j = m + 1; j <= n - m; j++) {
      if (i * 2 <= j) break;
      double x = (i - (j / 2.0));
      int p = max(
          0,
          min(int(x * (n - i + 1) / (x / 2 + 0.75 * j) - 0.0000000001), n - m) -
              m);
      if (i == n / 2 + 1)
        ans += p;
      else
        ans += 2 * p;
    }
  }
  cout << ans * 3 << endl;
  return 0;
}
