#include "bits/stdc++.h" using namespace std; using ll = long long; using pii = pair; using pll = pair; using vi = vector; using vl = vector; using vvi = vector; using vvl = vector; const ll INF = 1LL << 60; const ll MOD = 1000000007; template bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; } template bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; } template void print(const C &c, std::ostream &os = std::cout) { std::copy(std::begin(c), std::end(c), std::ostream_iterator(os, " ")); os << std::endl; } // list up all factors template set factors(T a) { set facs; for (T i = 1; i * i <= a; ++i) { if (a % i == 0) { facs.insert(i); facs.insert(a / i); } } return facs; } int main() { ll n, k; cin >> n >> k; auto facs = factors(k); ll ret = 0; for (auto &f : facs) { ll ac = f; ll bd = k / f; ll nac = ac - 1; if (n < ac - 1) nac = max(0LL, nac - 2 * (ac - 1 - n)); ll nbd = bd - 1; if (n < bd - 1) nbd = max(0LL, nbd - 2 * (bd - 1 - n)); ret += nac * nbd; } cout << ret << "\n"; return 0; }