import java.util.*;

class Main {
 public static void main(String[] args){
     Scanner sc = new Scanner(System.in);
     int a = sc.nextInt();
     int b = sc.nextInt();
     int count = 0;
     int tmp = 0;
     for(int i = 0; i < b-a+1; i++){
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     }
     System.out.print(count);
 }
 
 private static int flipNum(int tmp){
     String tmpStr = String.valueOf(tmp);
     StringBuilder sb = new StringBuilder(tmpStr).reverse();
     String flipTmpStr = sb.toString();
     int flipTmp = Integer.parseInt(flipTmpStr);
     return flipTmp;
 }
} import java.util.*; util.* java class Main {
 public static void main(String[] args){
     Scanner sc = new Scanner(System.in);
     int a = sc.nextInt();
     int b = sc.nextInt();
     int count = 0;
     int tmp = 0;
     for(int i = 0; i < b-a+1; i++){
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     }
     System.out.print(count);
 }
 
 private static int flipNum(int tmp){
     String tmpStr = String.valueOf(tmp);
     StringBuilder sb = new StringBuilder(tmpStr).reverse();
     String flipTmpStr = sb.toString();
     int flipTmp = Integer.parseInt(flipTmpStr);
     return flipTmp;
 }
} Main public static void main(String[] args){
     Scanner sc = new Scanner(System.in);
     int a = sc.nextInt();
     int b = sc.nextInt();
     int count = 0;
     int tmp = 0;
     for(int i = 0; i < b-a+1; i++){
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     }
     System.out.print(count);
 } main {
     Scanner sc = new Scanner(System.in);
     int a = sc.nextInt();
     int b = sc.nextInt();
     int count = 0;
     int tmp = 0;
     for(int i = 0; i < b-a+1; i++){
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     }
     System.out.print(count);
 } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int count = 0; count 0 int tmp = 0; tmp 0 for(int i = 0; i < b-a+1; i++){
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     } int i = 0; int i = 0; i 0 i < b-a+1 i b-a+1 b-a b a 1 i++ i++ i {
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     } {
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     } tmp = a + i tmp a + i a i if(tmp == flipNum(tmp)){
             count++;
         } tmp == flipNum(tmp) tmp flipNum(tmp) flipNum tmp {
             count++;
         } count++ count System.out.print(count) System.out.print System.out System System.out count String[] args args private static int flipNum(int tmp){
     String tmpStr = String.valueOf(tmp);
     StringBuilder sb = new StringBuilder(tmpStr).reverse();
     String flipTmpStr = sb.toString();
     int flipTmp = Integer.parseInt(flipTmpStr);
     return flipTmp;
 } flipNum {
     String tmpStr = String.valueOf(tmp);
     StringBuilder sb = new StringBuilder(tmpStr).reverse();
     String flipTmpStr = sb.toString();
     int flipTmp = Integer.parseInt(flipTmpStr);
     return flipTmp;
 } String tmpStr = String.valueOf(tmp); tmpStr String.valueOf(tmp) String.valueOf String tmp StringBuilder sb = new StringBuilder(tmpStr).reverse(); sb new StringBuilder(tmpStr).reverse() new StringBuilder(tmpStr).reverse new StringBuilder(tmpStr) String flipTmpStr = sb.toString(); flipTmpStr sb.toString() sb.toString sb int flipTmp = Integer.parseInt(flipTmpStr); flipTmp Integer.parseInt(flipTmpStr) Integer.parseInt Integer flipTmpStr return flipTmp; flipTmp int tmp tmp
import java.util.*;

class Main {
 public static void main(String[] args){
     Scanner sc = new Scanner(System.in);
     int a = sc.nextInt();
     int b = sc.nextInt();
     int count = 0;
     int tmp = 0;
     for(int i = 0; i < b-a+1; i++){
         tmp = a + i;
         if(tmp == flipNum(tmp)){
             count++;
         }
     }
     System.out.print(count);
 }
 
 private static int flipNum(int tmp){
     String tmpStr = String.valueOf(tmp);
     StringBuilder sb = new StringBuilder(tmpStr).reverse();
     String flipTmpStr = sb.toString();
     int flipTmp = Integer.parseInt(flipTmpStr);
     return flipTmp;
 }
}