/** * @FileName a.cpp * @Author kanpurin * @Created 2020.05.22 22:32:51 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int L, R; cin >> L >> R; int ans = 0; vector v(R+1,false); for (int i = L; i < R; i++) { if (v[i]) continue; for (int j = i + i; j <= R; j+=i) { v[j] = true; } } for (int i = L + 1; i <= R; i++) { if (!v[i]) { ans++; } } cout << ans << endl; return 0; }