#include <stdio.h>

int test(int a, int b);

int main() {
    int a, b;
    scanf("%d %d", &a, &b);
    int z = test(a, b);
    printf("%d", z);
    return 0;
}

int test(int a, int b) 
{
    int count = 0;
    for (int i = a; i <= b; i++) 
    {
        int temp = i;
        int sum = 0;
        while (temp > 0) 
        {
            sum += temp % 10;
            temp /= 10;
        }
        if (sum % 5 == 0) 
        {
            count++;
        }
    }
    return count;
}