int main()
{
int a,b;
scanf("%d %d",&a,&b);
int i = 0;
int count = 0;
for(i=a;i<=b;i++)
{
int k = i;
int sum = 0;
while(k)
{
int n = k%10;
sum+=n;
k/=10;
}
if(sum%5==0)
{
count++;
}
}
printf("%d\n",count);
return 0;
}