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