import java.util.*;

public class Main{
  
  public static void main (String[] args){
  
  	Scanner scanner = new Scanner (System.in);
    ArrayList <String> list = new ArrayList <String> ();
    
  	int numA = scanner.nextInt();
    int numB = scanner.nextInt();
   	int count = 0;
    
    for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    }	
   	System.out.println(count);
  }
} import java.util.*; util.* java public class Main{
  
  public static void main (String[] args){
  
  	Scanner scanner = new Scanner (System.in);
    ArrayList <String> list = new ArrayList <String> ();
    
  	int numA = scanner.nextInt();
    int numB = scanner.nextInt();
   	int count = 0;
    
    for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    }	
   	System.out.println(count);
  }
} Main public static void main (String[] args){
  
  	Scanner scanner = new Scanner (System.in);
    ArrayList <String> list = new ArrayList <String> ();
    
  	int numA = scanner.nextInt();
    int numB = scanner.nextInt();
   	int count = 0;
    
    for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    }	
   	System.out.println(count);
  } main {
  
  	Scanner scanner = new Scanner (System.in);
    ArrayList <String> list = new ArrayList <String> ();
    
  	int numA = scanner.nextInt();
    int numB = scanner.nextInt();
   	int count = 0;
    
    for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    }	
   	System.out.println(count);
  } Scanner scanner = new Scanner (System.in); scanner new Scanner (System.in) ArrayList <String> list = new ArrayList <String> (); list new ArrayList <String> () int numA = scanner.nextInt(); numA scanner.nextInt() scanner.nextInt scanner int numB = scanner.nextInt(); numB scanner.nextInt() scanner.nextInt scanner int count = 0; count 0 for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    } int i=numA; int i=numA; i numA i<=numB i numB i++ i++ i {
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    } {
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    } list.clear() list.clear list String phraseA = String.valueOf(i); phraseA String.valueOf(i) String.valueOf String i String[] templist = phraseA.split(""); templist phraseA.split("") phraseA.split phraseA "" for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      } int j=0; int j=0; j 0 j<phraseA.length() j phraseA.length() phraseA.length phraseA j++ j++ j {
        list.add(templist[j]);
      } {
        list.add(templist[j]);
      } list.add(templist[j]) list.add list templist[j] templist j boolean flag = true; flag true for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      } int j=0; int j=0; j 0 j<(phraseA.length())/2 j (phraseA.length())/2 (phraseA.length()) phraseA.length phraseA 2 j++ j++ j {
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      } {
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      } String temp = list.get(j); temp list.get(j) list.get list j String temp2 = list.get(phraseA.length()-1-j); temp2 list.get(phraseA.length()-1-j) list.get list phraseA.length()-1-j phraseA.length()-1-j phraseA.length() phraseA.length phraseA 1 j if (temp.equals(temp2)){
        } else {
          flag = false;
        } temp.equals(temp2) temp.equals temp temp2 {
        } {
          flag = false;
        } flag = false flag false if (flag == true){
        count++;
      } flag == true flag true {
        count++;
      } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main{
  
  public static void main (String[] args){
  
  	Scanner scanner = new Scanner (System.in);
    ArrayList <String> list = new ArrayList <String> ();
    
  	int numA = scanner.nextInt();
    int numB = scanner.nextInt();
   	int count = 0;
    
    for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    }	
   	System.out.println(count);
  }
} public class Main{
  
  public static void main (String[] args){
  
  	Scanner scanner = new Scanner (System.in);
    ArrayList <String> list = new ArrayList <String> ();
    
  	int numA = scanner.nextInt();
    int numB = scanner.nextInt();
   	int count = 0;
    
    for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    }	
   	System.out.println(count);
  }
} Main
import java.util.*;

public class Main{
  
  public static void main (String[] args){
  
  	Scanner scanner = new Scanner (System.in);
    ArrayList <String> list = new ArrayList <String> ();
    
  	int numA = scanner.nextInt();
    int numB = scanner.nextInt();
   	int count = 0;
    
    for (int i=numA; i<=numB; i++){
      list.clear();
      String phraseA = String.valueOf(i);
      String[] templist = phraseA.split("");
      for (int j=0; j<phraseA.length(); j++){
        list.add(templist[j]);
      }
      
      boolean flag = true;
      for (int j=0; j<(phraseA.length())/2; j++){
        String temp = list.get(j);;
        String temp2 = list.get(phraseA.length()-1-j);
        if (temp.equals(temp2)){
        } else {
          flag = false;
        }
      }
      if (flag == true){
        count++;
      }
    }	
   	System.out.println(count);
  }
}