#include #include #include #include #include #include #include #include #include #include #include static const int MOD = 1000000007; using ll = long long; using u32 = uint32_t; using namespace std; template constexpr T INF = ::numeric_limits::max()/32*15+208; template vector divisor(T n){ vector ret; for(T i = 1; i * i <= n; i++) { if(n % i == 0) { ret.push_back(i); if(i * i != n) ret.push_back(n / i); } } sort(begin(ret), end(ret)); return(ret); } int main() { ll n, k; cin >> n >> k; auto v = divisor(k); ll ans = 0; for (auto &&i : v) { auto j = k/i; ans += min(i-1, max(0LL, n-abs(n+1-i)))*min(j-1, max(0LL, n-abs(n+1-j))); } cout << ans << "\n"; return 0; }