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