#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define BR "\n"
#define SP " "
#define SHOW(x) for(int i = 0; i < x.size(); i++) { cout << x[i] << SP; } cout << BR;
#define SHOW2(x) for(int j = 0; j < x.size(); j++) { SHOW(x[j]); } cout << BR;

int main() {
  ll N, K;
  cin >> N >> K;

  ll ans = 0;
  for (ll i = 2; i <= sqrt(K); i++) {
    if (K % i != 0) continue;
    ll j = K / i;
    ll temp1 = max(i - 1 - N, 0LL) * 2;
    ll temp2 = max(j - 1 - N, 0LL) * 2;
    ll temp = max(i - 1 - temp1, 0LL) * max(j - 1 - temp2, 0LL);
    ans += temp;
    if (j != i) ans += temp;
  }

  cout << ans << "\n";

  return 0;
}