#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); ll N,K; cin >> N >> K; ll ans = 0; auto f = [N](ll x) { return max(0LL, min(N, x - 1) - max(1LL, x - N) + 1); }; for(ll L = 1; L * L <= K; L++) { if(K % L == 0) { if(L * L == K) { ans += f(L) * f(L); } else { ans += 2LL * f(L) * f(K / L); } } } cout << ans << endl; }