#include <stdio.h>
int fun(int a,int b){
int i,j,sum=0,count=0;
for(i=a;i<=b;i++){
j=i;
sum=0;
while(j!=0){
sum+=j%10;
j/=10;
}
if(sum%5==0) count++;
}
return count;
}
int main(){
long int a,b;
scanf("%ld%ld",&a,&b);
printf("%d",fun(a,b));
return 0;
}
int fun(int a,int b){
int i,j,sum=0,count=0;
for(i=a;i<=b;i++){
j=i;
sum=0;
while(j!=0){
sum+=j%10;
j/=10;
}
if(sum%5==0) count++;
}
return count;
}
int main(){
long int a,b;
scanf("%ld%ld",&a,&b);
printf("%d",fun(a,b));
return 0;
}