#include <bits/stdc++.h>
using namespace std;
int n, m, A;
void read(int &x) {
  char ch = getchar();
  int mark = 1;
  for (; ch != '-' && (ch < '0' || ch > '9'); ch = getchar())
    ;
  if (ch == '-') mark = -1, ch = getchar();
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
  x *= mark;
}
inline int min(const int x, const int y) { return (x < y) ? x : y; }
inline int max(const int x, const int y) { return (x > y) ? x : y; }
int main() {
  read(n);
  read(m);
  A = n + 1;
  int st = m + 1, en = n - m;
  long long ans = 0;
  for (int x = st; x <= (A >> 1); x++) {
    int k = en;
    long long tmp = 0;
    for (int a = st; a <= en && k >= st; a++) {
      for (; k >= st && (A - x) * ((x << 1) - a) <= k * (x + a); k--)
        ;
      tmp += k - m;
    }
    ans += tmp;
    if (x + x - 1 != n) ans += tmp;
  }
  printf("%I64d\n", ans * 3);
  return 0;
}
