#include<bits/stdc++.h> using namespace std; int main() { int a,b,ans; cin>>a>>b; for(int i=a;i<=b;i++) { bool flag=0; for(int j=2;j*j<=i;j++) if(i%j==0) { flag=1; break; } if(flag==0) ans++; } cout<<ans; return 0; }