#include using namespace std; int v[200030]; int main(){ long long n,m; cin >> n >> m; if (n==1){cout << 0 << endl; return 0;} for (long long i = 0; i < 200010; i++) { v[i] = 0; } for (long long i = n; i < (m + 20) ; i++) { if (v[i] == 1) continue; for (long long x = i * 2; x < m + 2; x += i){ v[x] = 1; } } long long ans = 0; for (long long i = n; i < m + 1; i++) { if (v[i] == 0) ans++; // cout << "v[" << i << "] = " << v[i] << endl; } cout << ans - 1 << endl; }