#include <iostream>
using namespace std;

int main() {
    int L, R;
    int count = 0;
    while(cin >> L >> R)
    {
        for(int i = L; i <= R; i++)
        {
            int j = i;
            while(j)
            {
                int ret = j % 10;
                j/=10;
                if(ret/2 == 1 && ret % 2 == 0)
                    count++;
            }
        }
    }
    cout << count;
}