#include <bits/stdc++.h>
using namespace std;
int n, m;
long long ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = m + 1; i + i <= n + 1; ++i) {
    int k = n - m, p = n + 1 - i;
    for (int j = m + 1; j <= n - m; ++j) {
      for (; k > m; --k)
        if ((p + k) * j < (p + p - k) * i) break;
      if (k == m) break;
      ans += (k - m) * (1 + (i + i <= n));
    }
  }
  printf("%I64d\n", ans * 3);
  return 0;
}
