#include<stdio.h>

int main(){

int x,y,c=0;

while(scanf("%d %d",&x,&y)
{
for(int i=x;i<=y;y++)
{
if(i%2==0)c++;
else if(i%3==0)c++;
else if(i%5==0)c++;
}
printf("%d\n",c);c=0;
}
return 0;
}

#include<stdio.h>

int main(){

int x,y,c=0;

while(scanf("%d %d",&x,&y))
{
for(int i=x;i<=y;i++)
{
if(i%2==0)c++;
else if(i%3==0)c++;
else if(i%5==0)c++;
}
printf("%d\n",c);c=0;
}
return 0;
}