#include using namespace std; int main(){ int L, R; cin >> L >> R; vector g(R + 1, -1); int cnt = 0; for (int i = L; i <= R; i++){ if (g[i] == -1){ g[i] = cnt; queue Q; Q.push(i); while (!Q.empty()){ int x = Q.front(); Q.pop(); for (int j = x * 2; j <= R; j += x){ if (g[j] == -1){ g[j] = cnt; Q.push(j); } } for (int j = 1; j * j <= x; j++){ if (x % j == 0){ if (L <= j && j < x){ if (g[j] == -1){ g[j] = cnt; Q.push(j); } } int k = x / j; if (L <= k && k < x){ if (g[k] == -1){ g[k] = cnt; Q.push(k); } } } } } cnt++; } } cout << cnt - 1 << endl; }