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