#include <bits/stdc++.h>
using namespace std;
const int NMax = 34000;
int N, M;
int X, Y;
inline bool judge(int b, int c) { return (b - X) * (Y - c) + 3 * b * c < 0; }
int main() {
  scanf("%d%d", &N, &M);
  N++;
  M++;
  int nn = N - M;
  long long ret = 0;
  for (int i = M; (i << 1) <= N; ++i) {
    int p = nn;
    int cnt = 0;
    X = (i << 1);
    Y = ((N - i) << 1);
    for (int j = M; j <= nn && p >= M; ++j) {
      while (p >= M && !judge(j, p)) --p;
      cnt += (p - M + 1);
    }
    if ((i << 1) == N)
      ret += cnt;
    else
      ret += (cnt << 1);
  }
  printf("%lld\n", ret * 3);
  return 0;
}
