#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T min(T &a, T &b) {
  return a < b ? a : b;
}
template <class T>
inline T max(T &a, T &b) {
  return a > b ? a : b;
}
template <class T>
void read(T &x) {
  char ch;
  while ((ch = getchar()) && !isdigit(ch))
    ;
  x = ch - '0';
  while ((ch = getchar()) && isdigit(ch)) x = x * 10 + ch - '0';
}
struct point {
  int x, y;
  point() {}
  point(int _x, int _y) : x(_x), y(_y) {}
};
int n, m, l;
long long ans;
int main() {
  read(n), read(m);
  l = n + 1;
  int c;
  for (int j = m + 1; j <= n - m; j++) {
    for (int i = m + 1; i <= n - m; i++) {
      int x = j * (j * 2 - l * 3) + l * l, y = l - j, z = l + j;
      if (i == m + 1)
        c = max((x + z * i) / (i + y), m);
      else
        while ((c + 1) * (i + y) <= x + z * i) c++;
      if (c + 1 <= n - m)
        ans += (long long)(n - m - c);
      else
        break;
    }
  }
  printf("%lld\n", ans * 3LL);
}
