import java.util.*;
class Main
{
 public static void main(String[] args)
  {
   Scanner s = new Scanner(System.in);
   int a = s.nextInt();
   int b = s.nextInt();
   int count = 0;
   boolean value ;
       for(int i=a;i<=b;i++)
       {
           if(checkpalin(i))
           count++;
       }
       
       System.out.println(count);
   
   }
   
   public static boolean checkpalin(int val)
   {
       String line = val+"";
       int flag = 0;
       for(int j=0;j<line.length()/2;j++)
       {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       }
       if(flag == 0)
       return true;
       else
       return false;
   }
} import java.util.*; util.* java class Main
{
 public static void main(String[] args)
  {
   Scanner s = new Scanner(System.in);
   int a = s.nextInt();
   int b = s.nextInt();
   int count = 0;
   boolean value ;
       for(int i=a;i<=b;i++)
       {
           if(checkpalin(i))
           count++;
       }
       
       System.out.println(count);
   
   }
   
   public static boolean checkpalin(int val)
   {
       String line = val+"";
       int flag = 0;
       for(int j=0;j<line.length()/2;j++)
       {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       }
       if(flag == 0)
       return true;
       else
       return false;
   }
} Main public static void main(String[] args)
  {
   Scanner s = new Scanner(System.in);
   int a = s.nextInt();
   int b = s.nextInt();
   int count = 0;
   boolean value ;
       for(int i=a;i<=b;i++)
       {
           if(checkpalin(i))
           count++;
       }
       
       System.out.println(count);
   
   } main {
   Scanner s = new Scanner(System.in);
   int a = s.nextInt();
   int b = s.nextInt();
   int count = 0;
   boolean value ;
       for(int i=a;i<=b;i++)
       {
           if(checkpalin(i))
           count++;
       }
       
       System.out.println(count);
   
   } Scanner s = new Scanner(System.in); s new Scanner(System.in) int a = s.nextInt(); a s.nextInt() s.nextInt s int b = s.nextInt(); b s.nextInt() s.nextInt s int count = 0; count 0 boolean value ; value for(int i=a;i<=b;i++)
       {
           if(checkpalin(i))
           count++;
       } int i=a; int i=a; i a i<=b i b i++ i++ i {
           if(checkpalin(i))
           count++;
       } {
           if(checkpalin(i))
           count++;
       } if(checkpalin(i))
           count++; checkpalin(i) checkpalin i count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean checkpalin(int val)
   {
       String line = val+"";
       int flag = 0;
       for(int j=0;j<line.length()/2;j++)
       {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       }
       if(flag == 0)
       return true;
       else
       return false;
   } checkpalin {
       String line = val+"";
       int flag = 0;
       for(int j=0;j<line.length()/2;j++)
       {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       }
       if(flag == 0)
       return true;
       else
       return false;
   } String line = val+""; line val+"" val "" int flag = 0; flag 0 for(int j=0;j<line.length()/2;j++)
       {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       } int j=0; int j=0; j 0 j<line.length()/2 j line.length()/2 line.length() line.length line 2 j++ j++ j {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       } {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       } if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           } line.charAt(j)!= line.charAt(line.length()-1-j) line.charAt(j) line.charAt line j line.charAt(line.length()-1-j) line.charAt line line.length()-1-j line.length()-1-j line.length() line.length line 1 j {
               flag =1;
               break;
           } flag =1 flag 1 break; if(flag == 0)
       return true;
       else
       return false; flag == 0 flag 0 return true; true return false; false int val val
import java.util.*;
class Main
{
 public static void main(String[] args)
  {
   Scanner s = new Scanner(System.in);
   int a = s.nextInt();
   int b = s.nextInt();
   int count = 0;
   boolean value ;
       for(int i=a;i<=b;i++)
       {
           if(checkpalin(i))
           count++;
       }
       
       System.out.println(count);
   
   }
   
   public static boolean checkpalin(int val)
   {
       String line = val+"";
       int flag = 0;
       for(int j=0;j<line.length()/2;j++)
       {
           if(line.charAt(j)!= line.charAt(line.length()-1-j))
           {
               flag =1;
               break;
           }
       }
       if(flag == 0)
       return true;
       else
       return false;
   }
}
