#include<iostream>
using namespace std;
bool zhi(int x){
if(x==2) return true;
for(int i=2;i<=x;i++){
if(x%i==0) return false;
return true;
}
}
int a,b;
int main(){
cin>>a>>b;
int he=0;
for(int i=a;i<=b;i++){
if(zhi(i)) he+=1;
}
cout<<he;
return 0;
}