#include <cstdio>
#include <iostream>
#include <sstream>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	int count=0;
	for(int i=a;i<=b;i++)
	{
		stringstream ss;
		string s;
		ss<<i;
		ss>>s;
		int l=s.length();
		string s1;
		//cout<<s<<endl;
		for(int i=0;i<l;i++)
		{
			//cout<<s[l-i-1]<<endl;
			s1[i]=s[l-i-1];
			//cout<<s1[i]<<endl;
		}
		int j=0;
		for(j=0;j<l;j++)
		{
			if(s[j]==s1[j]) continue;
			else break;
		}
		if(j==l) count++;
		else continue;
	}
	cout<<count<<endl;
	return 0;
}