#include <bits/stdc++.h>

int main()
{
	int64_t N, K;
	scanf("%lld%lld", &N, &K);
	int64_t ans{};
	for (int64_t i{2}; i * i <= K; i++)
	{
		if (K % i) continue;
		int64_t pair{K / i};
		if (i > 2 * N || pair > 2 * N) continue;
		int64_t tmp{1};
		if (i * i != K) tmp *= 2;
		if (i <= N + 1) tmp *= i - 1;
		else tmp *= N - (i - N - 1);
		if (pair <= N + 1) tmp *= pair - 1;
		else tmp *= N - (pair - N - 1);
		ans += tmp;
	}
	printf("%lld\n", ans);

	return 0;
}