#include <bits/stdc++.h>
using namespace std;
int ans = 0;
void howmany(int x)
{
if(x == 0)
{
return;
}
else if(x % 10 == y)
{
ans++;
}
howmany(x / 10);
}
int main()
{
int n,m;
cin >> n >> m;
for(int i = n;i <= m;i++)
{
howmany(i);
}
cout << ans << endl;
return 0;
}