#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
bool ispri(int n)
{
if (n < 2)
return 0;
for (int i = 2; i <= sqrt(n); i++)
if (n % i == 0)
return 0;
return 1;
}
int main()
{
int x, y;
cin >> x >> y;
int ans = 0;
for (int i = x; i <= y; i++)
if (ispri(i))
ans++;
cout << ans;
return 0;
}