#include using namespace std; int main() { int64_t N, K; cin >> N >> K; int64_t ans = 0; for (int i = 1; 1LL * i * i <= K; ++i) { int64_t j = K / i; if (1LL * i * j != K) continue; auto calc = [&](int64_t q) -> int64_t { if (q <= N) return q - 1; if (q < 2 * N + 1) return N - (q - N) + 1; return 0; }; ans += 1LL * calc(i) * calc(j); if (i != j) ans += 1LL * calc(i) * calc(j); } cout << ans << endl; return 0; }