#include<stdio.h>

int select(int i,int count)
{
    int a=0;
    int sum=0;
    for(a=0;a<count;a++)
    {
        sum=sum+i%10;
        i=i/10;
    }
    return sum;
}

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