#include <bits/stdc++.h>
using namespace std;

#define fi  first
#define se  second
#define mp  make_pair
#define pb  push_back
#define pf  push_front
#define in  insert

#define rev(v) reverse(v.begin(),v.end())
#define srt(v) sort(v.begin(),v.end())
#define grtsrt(v) sort(v.begin(),v.end(),greater<ll>())
#define all(v) v.begin(),v.end()
#define mnv(v) *min_element(v.begin(),v.end())
#define mxv(v) *max_element(v.begin(),v.end())
#define For(i,j,k) for(ll i=j;i<k;i++)
#define Rev(i,j,k) for(ll i=j;i>k;i--)
#define Rep(i,k)   for(ll i=0;i<k;i++)

#define mnn (long long) -1000000000000000
#define mxn (long long) 1000000000000000
#define eps 1e-9
#define MOD 1000000007

typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vll;
typedef map<ll, ll> mll;
typedef pair<ll, ll> pll;
typedef pair<ll, bool> plb;

#define sl(x) scanf("%lld",&x)
#define sll(x,y) scanf("%lld %lld",&x,&y)
#define slll(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define sd(x) scanf("%lf",&x)
#define sdd(x,y) scanf("%lf%lf",&x,&y)
#define sddd(x,y,z) scanf("%lf%lf%lf",&x,&y,&z)
#define ss(str) scanf("%s",str)
#define pl(x) printf("%lld",x)
#define pll(x,y) printf("%lld %lld",x,y)
#define plll(x,y,z) printf("%lld %lld %lld",x,y,z)
#define ps(ss) printf("%s",ss)

#define mem(ara,val) memset(ara,val,sizeof(ara))
#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);


const int maxn  =     1e5+5;
const double pi =     2.0*acos(0.0);
const double EPS=     1e-11;

/// Binary Segment

/*
ll _LeftIP_BinarySearch(ll st,ll nd,ll key,ll *_Arr)
{
    if(st>nd) return st;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>=key) return _LeftIP_BinarySearch(st,md-1,key,_Arr);
    else return _LeftIP_BinarySearch(md+1,nd,key,_Arr);

}
ll _RightIP_BinarySearch(ll st,ll nd,ll key,ll *_Arr)
{
    if(st>nd) return st;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>key) return _RightIP_BinarySearch(st,md-1,key,_Arr);
    else return _RightIP_BinarySearch(md+1,nd,key,_Arr);
}

ll _CountByBinarySearch(ll st,ll nd, ll key,ll *_Arr)
{
    if(st>nd) return 0;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>key) return _CountByBinarySearch(st,md-1,key,_Arr);
    else if (_Arr[md]<key)  return _CountByBinarySearch(md+1,nd,key,_Arr);
    else return 1 + _CountByBinarySearch(st,md-1,key,_Arr)+ _CountByBinarySearch(md+1,nd,key,_Arr);
}

ll _BinarySearch(ll st,ll nd,ll key,ll *_Arr)
{
    if(st>nd) return 0;
    ll md= (st+nd)>>1 ;
    if(_Arr[md]>key) return _BinarySearch(st,md-1,key,_Arr);
    else if (_Arr[md]<key)  return _BinarySearch(md+1,nd,key,_Arr);
    return md;
}

*/


/// Number theory
/*

ll _Primes[32000],pp,ap,bp,sqt=31622;
bool pra[32000],ara[100010];
void _Sieve()
{
    ll j=0;
    pra[0]=1;
    For(i,2,sqt+1) if(!pra[i]) for(j=i*i;j<=sqt;j+=i) pra[j]=1;
    For(i,2,sqt+1) if(!pra[i]) _Primes[pp++]=i;
}
ll _SegmentSeive()
{
    mem(ara,0); ///a and b is the segment a < b
    For(i,0,pp)
    {
        ll my=_Primes[i];
        ll cur=a/my;
        if(a%my)cur++;
        cur*=my;
        for(ll j=cur;j<=b;j+=my)
        {
            if(j!=my) ara[j-a]=1;
        }
    }
    For(i,a,b+1) {if(!ara[i-a] && i!=1) printf("%lld\n",i);}
}

ll gcd(ll x,ll y )
{
    if(y==0) return x;
    return gcd(y,x%y);
}
ll lcm(ll x,ll y)
{
    return (x*y)/gcd(x,y);
}
ll glcm(ll x,ll y,ll gcd)
{
    return (x*y)/gcd;
}
ll sumDigit(ll n)
{
    if (n == 0)
       return 0;
    return (n % 10 + sumDigit(n / 10));
}
ll _pow(ll n,ll mod)
{
     if(n==0) return 1;
     ll k=_pow(n/2,mod);
     k=(k*k)%mod;
     if(n%2) k=(k*2)%mod;
     return k;
}
bool _isPrime(ll n)
{
     if(n==2) return true;
     if(n<2 || n%2==0) return false;
     for(ll i=3;i*i<=n;i+=2)
        if(n%i==0) return false;
     return true;
}
 bool isPowerOfTwo(ll n)
{
   return (ceil(log2(n)) == floor(log2(n)));
}
//ll bOx[100][100];
ll nCr( ll n, ll r)
{
    if(r==1) return n;
    if(n==r) return 1;
    if(bOx[n][r]!=-1) return bOx[n][r];
    bOx[n][r]= nCr(n-1,r) + nCr(n-1,r-1);
    return bOx[n][r];
}
*/
ll toNum(string s)
{
    ll ret = 0, sig = 1, i=0;
    if(!s.empty() && s[0] == '-') sig = -1, i++;
    while(i < s.size() && s[i] >= '0' && s[i] <= '9')
        ret = ret * 10 + (s[i++] - '0');
    return ret*sig;
}
string toStr(ll x)
{
    string s = "";
	if (x == 0) return "0";
	while(x > 0)
	{
		s = (char)('0' + (x % 10)) + s;
		x /= 10;
	}
	return s;
}

///Direction
/*
ll row,col;
#define valid0(x,y) x<0 || x>=row || y<0 || y>=col
#define valid1(nx,ny) nx>=1 && nx<=row && ny>=1 && ny<=col
ll fx[]={1,-1,0,0}; //4 side 2d
ll fy[]={0,0,1,-1};
//ll fx[]={+0,+0,+1,-1,-1,+1,-1,+1}; //8 side 2d
//ll fy[]={-1,+1,+0,+0,+1,+1,-1,-1};
//ll dx[] = {-2, -2, -1, -1, +1, +1, +2, +2};//Knight move
//ll dy[] = {-1, +1, -2, +2, -2, +2, -1, +1};

*/
//Needed variables and arrays
//I am such a bad person to keep them outside from all functions and using them continuously :p such selflessness xD


ll a,b,c,d,e,f,g,h;
string s,t ;
vector<ll> arr;
ll cost[1000],weight[1000];

bool solve(ll i )
{

    bool ool=false;
    s= toStr(i);
    t=s;
    reverse(all(t));
    //cout<<s<<t;
    if(s==t)
    ool=true;
    return ool;
}
void read()
{
    cin>>a>>b;

    For(i,a,b+1)
    {
        if(solve(i)) c++;
    }
    cout<<c;
}
int main()
{
    fast_io;
   read();
}
/*
1 5 3
3 1 10 10 1
4 8 2 2 7
*/


Measured memory_bytes: 256