#include #include #include using namespace std; using namespace atcoder; using ll = long long; using mint = modint; using edge = pair>; int main() { vector ED; int L, R;cin >> L >> R; int N = R - L + 1; for (int l = L;l < R;l++) { ED.push_back({1, {l - L, l + 1 - L}}); int now = 2 * l; while (now <= R) { ED.push_back({0LL, {l - L, now - L}}); now += l; } } sort(ED.begin(), ED.end()); dsu uf(N); ll ans = 0; for (auto ed : ED) { int a = ed.second.first;int b = ed.second.second; if (!uf.same(a, b)) { uf.merge(a, b); ans += ed.first; } } cout << ans << endl; }