#include typedef long long ll; using namespace std; #define DUMP(x) cout << #x << " = " << (x) << endl; #define FOR(i, m, n) for(ll i = m; i < n; i++) #define IFOR(i, m, n) for(ll i = n - 1; i >= m; i-- ) #define REP(i, n) FOR(i,0,n) #define IREP(i, n) IFOR(i,0,n) #define FOREACH(x,a) for(auto& (x) : (a) ) #define ALL(v) (v).begin(), (v).end() int main(){ ll N, K; cin >> N >> K; ll ans = 0; for(ll i=2; i*i<=K && i<=2*N; ++i){ if(K%i != 0 || K/i>2*N) continue; ll t = 1; if(i<=N+1) t *= (i-1); else t *= 2*N-i+1; if(K/i<=N+1) t *= (K/i-1); else t *= (2*N-K/i+1); if(i != K/i) ans += t*2; else ans += t; } cout << ans << endl; }