#pragma GCC optimize("Ofast") #include using namespace std; typedef long long ll; #define EPS (1e-7) #define INF (1e9) #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define all(x) x.begin(),x.end() const double PI = acos(-1); const ll MOD = 1000000007; template inline bool chmax(T &a, T b) { if(a < b) { a = b; return true; } return false; } template inline bool chmin(T &a, T b) { if(a > b) { a = b; return true; } return false; } /////////////////////////////////////////////////////////////// int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll N,K; cin >> N >> K; vector A; for (int i = 2; i*i <= K; i++) { if (K % i == 0) { if (i*i != K) { A.emplace_back(i); A.emplace_back(K/i); } else A.emplace_back(i); } } ll ans = 0; rep(i,A.size()) { if (A[i] > 2LL*N || K/A[i] > 2LL*N) continue; ll p = {A[i]-1 <= N ? A[i]-1LL : 2LL*N-A[i]+1}; ll q = {K/A[i]-1 <= N ? K/A[i]-1LL : 2LL*N-K/A[i]+1LL}; ans += p*q; } cout << ans << endl; }