#include <iostream>
#include <algorithm>
#include <vector>
#include <tuple>
#include <cstring>


#define REP(i, n) for(int (i) = 0; (i) < (n); ++(i))
#define eREP(i, n) for(int (i) = 0; (i) <= (n); ++(i))
#define ALL(TheArray) TheArray.begin(), TheArray.end()

template <class T> inline T& chmax(T& a, T b){return (a < b) ? a = b : a;}
template <class T> inline T& chmin(T& a, T b){return (a > b) ? a = b : a;}

using lli = long long int;





int main(void){
    lli n, k; std::cin >> n >> k;
    // (a + c)(b + d) = K
    lli res = 0;
    for(lli x = 2; x * x <= k; x++) if(k % x == 0){
        lli y = k / x;
        if(not(2 <= x and x <= 2 * n and 2 <= y and y <= 2 * n)) continue;
        // a + c = x
        // b + d = y
        // c = x - a -> 1 ≤ x - a ≤ N => x - N ≤ a ≤ x - 1
        lli L = x - n; if(L < 1) L = 1;
        lli U = x - 1; if(U > n) U = n;
        lli A = U - L + 1;
        L = y - n; if(L < 1) L = 1;
        U = y - 1; if(U > n) U = n;
        lli B = U - L + 1;
        if(x == y) res += A * B;
        else res += 2 * A * B;
    }
    std::cout << res  << '\n';
    return 0;
}