#include #define rep(i, n) for (int i = 0; i < int(n); i++) using namespace std; using ll = long long; using P = pair; int main() { ll n, k; cin >> n >> k; auto f = [&](ll x) { if (x <= n + 1) return x - 1; else if (x >= 2 * n + 1) return 0LL; else return 2 * n - x + 1; }; ll ans = 0; for (ll i = 2; i * i <= k; i++) { if (k % i != 0) continue; ll x = f(i), y = f(k / i); if (i * i != k) ans += x * y * 2; else ans += x * y; } cout << ans << endl; }