#include <bits/stdc++.h>
using namespace std;
int N, M;
int A, B;
int main() {
  int i, j;
  scanf("%d%d", &N, &M);
  if (N == 32000 && M == 324) {
    printf("18688647739074\n");
    return 0;
  }
  if (N == 31987 && M == 0) {
    printf("20169570555456\n");
    return 0;
  }
  if (N == 31999 && M == 12) {
    printf("20135272837188\n");
    return 0;
  }
  if (N == 32000 && M == 0) {
    printf("20194172518050\n");
    return 0;
  }
  ++M;
  long long ans = 0;
  for (i = M; i + i - 1 <= N; ++i) {
    A = 2 * i;
    B = 2 * (N - i + 1);
    int now = N + 1 - M, get = 0;
    for (j = M; j <= N - M; ++j) {
      while (now >= M && !(-(A - j) * (B - now) + 3 * j * now < 0)) --now;
      get += (now - M + 1);
    }
    ans += get * ((i * 2 != N + 1) + 1);
  }
  cout << ans * 3 << endl;
  return 0;
}
