#include <bits/stdc++.h>
using namespace std;
const double gen3 = sqrt(3.0);
int n, m;
long long calc() {
  long long ans = 0;
  for (int i = m + 1; i + m <= n && i <= (n + 1) / 2; ++i) {
    double xi = i / 2.0, yi = i * gen3 / 2;
    int sum = 0;
    for (int j = m + 1; j + m <= n; ++j) {
      double xj = (n + 1) / 2.0 + j / 2.0,
             yj = (n + 1) * gen3 / 2 - j * gen3 / 2;
      int val = max(
          0, min(n - m, (int)((yj - yi) * yi / (xj - xi) + xi - 1e-10)) - m);
      sum += val;
      if (!val) break;
    }
    if (i * 2 != (n + 1)) sum *= 2;
    ans += sum;
  }
  return ans * 3;
}
int main() {
  scanf("%d %d", &n, &m);
  cout << calc() << endl;
  return 0;
}
