#include using namespace std; #define all(x) (x).begin(), (x).end() #define rep(i, n) for (int i = 0; i < (n); i++) #define endl "\n" typedef long long ll; typedef pair pii; typedef pair pll; template ostream &operator<<(ostream &os, const vector &vec){os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os; } template ostream &operator<<(ostream &os, const pair &p) {os << "(" << p.first << ", " << p.second << ")"; return os;} ll f(ll x, ll N) { if (x > N * 2) return 0; else if (x < 2) return 0; return min(x - 1, N * 2 - x + 1); } void solve() { ll N, K; cin >> N >> K; ll ans = 0; for(ll n = 1; n * n <= K; n++) { if (K % n == 0) { ll m = K / n; ans += (n * n != K) ? 2 * f(n, N) * f(m, N) : f(n, N) * f(m, N); } } cout << ans << endl; } int main() { cin.tie(0); ios::sync_with_stdio(false); cout.setf(ios::fixed); cout.precision(16); solve(); return 0; } // b(a + c) + d(a + c) // (a + c)(b + d) = K