#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

template<class Z> V<Z> divisor(Z n) {
  V<Z> res;
  Z i;
  for (i = 1; i * i < n; ++i) if (n % i == 0) res.push_back(i), res.push_back(n / i);
  if (i * i == n) res.push_back(i);
  sort(begin(res), end(res));
  return res;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  lint n, k; cin >> n >> k;
  auto fn = [&](lint x) -> lint {
    if (x > 2 * n) return 0;
    if (x <= n + 1) return max<lint>(x - 1, 0);
    return 2 * n - x + 1;
  };
  lint res = 0;
  for (lint d : divisor(k)) {
    res += fn(d) * fn(k / d);
  }
  cout << res << '\n';
}