#include <bits/stdc++.h>
using namespace std;
int nholes, nskip;
void run(int casenr) {
  scanf("%d%d", &nholes, &nskip);
  int L = nholes + 1;
  long long ret = 0;
  for (int a = (1 + nskip); a <= (nholes - nskip); ++a) {
    if (nholes - a + 1 < a) continue;
    int maxb = min(nholes - nskip, 2 * a - 1);
    long long cur = 0;
    for (int b = (1 + nskip); b <= (maxb); ++b) {
      int minc = 1 + nskip;
      int maxc = min(nholes - nskip, ((2 * a - b) * (L - a) - 1) / (a + b));
      if (minc <= maxc) cur += maxc - minc + 1;
    }
    ret += cur;
    if (nholes - a + 1 > a) ret += cur;
  }
  cout << (3 * ret) << endl;
}
int main() {
  run(1);
  return 0;
}
