#include using namespace std; #define fi first #define se second #define pb push_back using vi = vector ; using ll = long long; using pii = pair ; const ll mod = 998244353; //~ const ll mod = 1e9 + 7; ll qpow(ll a, ll b, ll m = mod) { ll r = 1, t = a; for(; b; b /= 2) { if(b & 1) r = r * t % m; t = t * t % m; } return r; } const int N = 2e5 + 11; int p[N]; int find(int x) { if(p[x] == x) return x; return p[x] = find(p[x]); } int main() { ios :: sync_with_stdio(false); int l, r; cin >> l >> r; iota(p, p + r + 1, 0); int ans = r - l; for(int i = l; i <= r; i ++) for(int j = i; j <= r; j += i) { int u = find(i), v = find(j); if(u != v) { ans --; p[v] = u; } } cout << ans << '\n'; }