#include <stdio.h>

void sum (int a,int b)
{
    int count = 0;//计数器
    int sum = 0,i,t,j;
    for(i = a;i<=b;i++)
    {
        t = i;
        sum = t%10;//让sum 等于t的个位
        for(j = 0;t>0;j++)
        {
            t = t/10;
            sum = sum + t%10;
        }
    

        if (sum % 5 == 0)
        {
            count++;
            
        }
        
    }
    printf("%d\n",count);
    
}
int main()
{
    int a,b;
    scanf("%d%d",&a,&b);
    sum(a,b);

    return 0;
}