#include using namespace std; int main(){ long long L, R; cin >> L >> R; vector fac(1000010); iota(fac.begin(), fac.end(), 0); for(int i = 2; i < 1000010; i++){ if(fac[i] != i) continue; for(int j = i * 2; j < 1000010; j += i){ fac[j] = i; } } vector t(R - L + 1); vector temp; vector num(R - L + 1); iota(t.begin(), t.end(), L); for(int i = 2; i <= 1000010; i++){ if(fac[i] != i) continue; for(long long j = (L + i - 1) / i * i; j <= R; j += i){ int cnt = 0; while(t[j - L] % i == 0){ t[j - L] /= i; cnt++; } if(cnt > 1) num[j - L] = -1; } } for(int i = 0; i < R - L + 1; i++){ if(num[i] == 0) temp.push_back(L + i); } int ans = temp.size(); for(int i = 0; i < (int)temp.size(); i++){ long long ub = 1000000000, lb = 0; while(ub - lb > 1){ long long mid = (ub + lb) / 2; if(mid * mid >= t[temp[i] - L]) ub = mid; else lb = mid; } if(ub != 1 && ub * ub == t[i]) ans--; } cout << ans << endl; }