#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int n, m;
ll ans = 0;
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  int l = m + 1, r = n - m;
  for (int b = l; b <= r; b++) {
    int bb = n + 1 - b;
    if (bb < b) continue;
    int cur = 0, lim = 3 * b * bb - 1;
    int lc = l + bb, rc = r + bb, la = l + b, ra = r + b;
    int tmp = lim / rc - 3;
    if (tmp > la) cur += (tmp - la) * (rc - lc + 1), la = tmp;
    for (int a = la; a <= ra; a++) {
      int mx = lim / a;
      if (mx >= rc)
        cur += rc - lc + 1;
      else if (mx >= lc)
        cur += mx - lc + 1;
      else
        break;
    }
    ans += cur;
    if (bb != b) ans += cur;
  }
  cout << ans * 3 << endl;
  return 0;
}
