#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, up = (n + 1) / 2; i <= up; i++) {
    for (int j = m + 1; j <= n - m; j++) {
      int g = (n + 1 - i) * (2 * i - j);
      int tj = (g + i + j - 1) / (i + j) - 1;
      if (tj <= m) break;
      ans += min(tj, n - m) - m;
    }
    if (i == n / 2) ans <<= 1;
  }
  printf("%I64d\n", ans * 3);
  return 0;
}
