#include <bits/stdc++.h>
using namespace std;
long long res[32100];
int main() {
  int n, m, N, rr, b, c, bb, rc, ra;
  long long tot;
  scanf("%d%d", &n, &m);
  m++;
  N = n + 1;
  rr = N - m;
  tot = 0;
  for (b = m; b <= rr; b++) {
    rc = (b * (2 * N - 2 * b - m) - 1) / (N + m - b);
    bb = N - b;
    if (bb < b)
      res[b] = res[bb];
    else {
      res[b] = 0;
      for (c = m; c <= rc && c <= rr; c++) {
        ra = (bb * (2 * N - 2 * bb - c) - 1) / (N + c - bb);
        if (ra > rr) ra = rr;
        if (ra < m) continue;
        res[b] += ra - m + 1;
      }
    }
    tot += res[b];
  }
  printf("%I64d\n", 3 * tot);
  return 0;
}
