//C++ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if __cplusplus >= 201103L #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #if __cplusplus >= 201402L #include #endif #if __cplusplus >= 201703L #include #include // #include #include #include #include #include #include #endif #if __cplusplus > 201703L #include #include #include #include #if __cpp_impl_coroutine #include #endif #include #include #include #include #include #include #include #include #include #endif //C #ifndef _GLIBCXX_NO_ASSERT #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #if __cplusplus >= 201103L #include #include #include #include #include #include #include #include #include #endif #include using namespace atcoder; //#define int ll using namespace std; using ll = long long; using ld = long double; using ull = unsigned long long; using uint = unsigned int; using pii = pair; using pll = pair; using pdd = pair; using Graph = vector>; #define rep1(i, n) for(ll i = 0; i < (int)(n); i++) #define rep2(i, a, b) for(ll i = (int)(a); i < (int)(b); i++) #define rep3(i, a, b, c) for(ll i = (int)(a); i < (int)(b); i+=(int)(c)) #define rrep1(i, n) for(ll i = (int)(n); i >= 0; i--) #define rrep2(i, a, b) for(ll i = (int)(b); i >= (int)(a); i--) #define REP(i) for(ll i = 0; ; i++) #define all(v) (v).begin(), (v).end() template using pq = priority_queue, greater>; template bool chmin(T &a, const T &b){ if(a > b){ a = b; return 1; } else return 0; } template bool chmax(T &a, const T &b){ if(a < b){ a = b; return 1; } else return 0; } template auto min(const T& a){ return *min_element(all(a)); } template auto max(const T& a){ return *max_element(all(a)); } template ll sum(const T& a){ return accumulate(all(a), 0LL); } template ld dsum(const T& a){ return accumulate(all(a), 0.0L); } const int MOD = 1000000007; const int MMOD = 998244353; const int MAX = 510000; const ll INF = 1LL<<60; ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; } ll lcm(ll a, ll b){ if(!a || !b) return 0; return a * b / gcd(a, b); } ll POW(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; } ll MODPOW(ll a, ll b){ ll ret = 1; while(b){ if(b & 1) ret = ret*a%MOD; a = a*a%MOD; b /= 2;} return ret;} long long fac[MAX], finv[MAX], inv[MAX]; void COMinit() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; for (int i = 2; i < MAX; i++){ fac[i] = fac[i - 1] * i % MOD; inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD; finv[i] = finv[i - 1] * inv[i] % MOD; } } long long COM(int n, int k){ if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD; } bool is_prime(ll n){ if(n == 1) return false; if(n == 2) return true; for(ll i = 2; i*i<=n; i++) if(n%i == 0) return false; return true; } signed main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); COMinit(); ll N, K; cin >> N >> K; ll ans = 0; rep2(i, 1, sqrt(K)+1){ if(K%i==0){ ll c1 = 0, c2 = 0; c1 += (i <= 1 || i > 2*N ? 0 : (2 <= i && i <= N+1 ? i-1 : 2*N-i+1)); ll Q = K/i; c2 += (Q <= 1 || Q > 2*N ? 0 : (2 <= Q && Q <= N+1 ? Q-1 : 2*N-Q+1)); ans += c1*c2*2; if(i*i == K) ans -= c1*c2; } } cout << ans << endl; }