#include <iostream>
#include <cstring>

using namespace std;

bool five_bei(int*p,int a);

int main()
{
    int str[7] = { 0 };
    int str2[10000] = { 0 };
    int sum2=0;
    int count = 0;
    int a, b;
    cin >> a >> b;
    for (int i = a; i <= b; i++)
    {
        str2[i-a]=five_bei(str, i);
        count++;
    }
    for (int i = 0; i < count; i++)
    {
        sum2 += str2[i];
    }
    cout << sum2 << endl;
    return 0;
}

bool five_bei(int*p,int a)
{
    int count1 = 0, sum1 = 0;
    int i=a;
    memset(p, 0, sizeof(p));

    for (int j=0; j<7,i != 0;j++)
    {
        p[j] = i % 10;
        i = i / 10;
        count1++;
    }
    for (int i = 0; i < count1; i++)
    {
        sum1 += p[i];
    }
    if (sum1 % 5 == 0)
    {
        return true;
    }
    else
    {
        return false;
    }
}