#include<bits/stdc++.h>
using namespace std;
int x,y,cnt;
bool m=true;
int zhishu(int n)
{
int cmt;
for(int j=2;j<=sqrt(n);j++)
{
if(n%j==0)cmt++;
}
if(cmt==0)m=true;
else m=false;
return m;
}
int main()
{
cin>>x>>y;
for(int i=x;i<=y;i++)
{
zhishu(i);
if(m=true)cnt++;
}
cout<<cnt;
return 0;
}