#include #define REP(i, n) for(int i = 0; (i) < (n); (i)++) using namespace std; bool check[200005]; int L, R; typedef pair P; int main() { cin >> L >> R; REP(i, R+1) check[i] = false; int ans = 0; for(int i=L;i<=R;i++){ if(check[i]) continue; ans++; queue

que; que.push(P(i, 0)); check[i] = true; while(!que.empty()){ P p = que.front(); que.pop(); if(p.second == 0){ for(int j=2; p.first * j <= R; j++){ if(!check[p.first*j]){ check[p.first*j] = true; que.push(P(p.first * j, 1)); } } }else{ for(int j=L; j*j <= p.first; j++){ if(p.first%j==0){ if(!check[p.first/j] && p.first/j>=L){ check[p.first/j] = true; que.push(P(p.first/j, 0)); } if(!check[j]){ check[j] = true; que.push(P(j, 0)); } } } } } } cout << ans-1 << endl; return 0; }