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