#include <bits/stdc++.h>
using namespace std;
int func(int x_low, int x_high, int y_low, int y_high, int maxprod) {
  int i, ans = 0;
  for (i = x_low; i <= x_high; i++) {
    int y = min(y_high, maxprod / i);
    if (y >= y_low)
      ans += y - y_low + 1;
    else
      break;
  }
  return ans;
}
int main(void) {
  int N, M, p, q;
  cin >> N >> M;
  if (M * 2 == N) {
    cout << 0 << endl;
    return 0;
  }
  long long ans = 0;
  for (p = 1 + M; p <= (N + 1) / 2; p++) {
    q = N + 1 - p;
    int x_low = 1 + M + p;
    int x_high = N - M + p;
    int y_low = 1 + M + q;
    int y_high = N - M + q;
    int tmp = func(x_low, x_high, y_low, y_high, 3 * p * q - 1);
    ans += tmp;
    if (p != q) ans += tmp;
  }
  cout << 3 * ans << endl;
  return 0;
}
