#include <stdio.h>
int main()
{
    int i,x,y,j,a[100];
    scanf("%d%d",&x,&y);


        for(i=x,j=0;i<=y;i++)
        {
           a[0] = i/10000;
           a[1] = i/1000%10;
           a[2] = i/100%10;
           a[3] = i/10%10;
           a[4] = i%10;

           if(a[0] == a[4]&&a[1] == a[3])
           {
              j++;
           }
        }
          printf("%d\n",j);

     return 0;
}
