import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();
  int count=0;
  for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  }
  System.out.println(count);
}
} import java.util.*; util.* java public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();
  int count=0;
  for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  }
  System.out.println(count);
}
} Main public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();
  int count=0;
  for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  }
  System.out.println(count);
} main {
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();
  int count=0;
  for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  }
  System.out.println(count);
} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc int m=sc.nextInt(); m sc.nextInt() sc.nextInt sc int count=0; count 0 for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  } int i=n; int i=n; i n i<=m i m i++ i++ i {
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  } {
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  } String po=i+""; po i+"" i "" if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    } po.length()%2==0 po.length()%2 po.length() po.length po 2 0 {
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    } while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        } po.length()!=0 po.length() po.length po 0 {
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        } if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break; po.substring(0,1).equals(po.substring(po.length()-1,po.length())) po.substring(0,1).equals po.substring(0,1) po.substring po 0 1 po.substring(po.length()-1,po.length()) po.substring po po.length()-1 po.length() po.length po 1 po.length() po.length po po=po.substring(1,po.length()-1) po po.substring(1,po.length()-1) po.substring po 1 po.length()-1 po.length() po.length po 1 break; if(po.length()==0)count++; po.length()==0 po.length() po.length po 0 count++ count {
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    } while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        } po.length()!=1 po.length() po.length po 1 {
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        } if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break; po.substring(0,1).equals(po.substring(po.length()-1,po.length())) po.substring(0,1).equals po.substring(0,1) po.substring po 0 1 po.substring(po.length()-1,po.length()) po.substring po po.length()-1 po.length() po.length po 1 po.length() po.length po po=po.substring(1,po.length()-1) po po.substring(1,po.length()-1) po.substring po 1 po.length()-1 po.length() po.length po 1 break; if(po.length()==1)count++; po.length()==1 po.length() po.length po 1 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 sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();
  int count=0;
  for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  }
  System.out.println(count);
}
} public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();
  int count=0;
  for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  }
  System.out.println(count);
}
} Main
import java.util.*;
public class Main{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();int m=sc.nextInt();
  int count=0;
  for(int i=n;i<=m;i++){
  	String po=i+"";
    if(po.length()%2==0){
    	while(po.length()!=0){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==0)count++;
    }
    else{
    while(po.length()!=1){
        	if(po.substring(0,1).equals(po.substring(po.length()-1,po.length())))po=po.substring(1,po.length()-1);
          else break;
        }
      if(po.length()==1)count++;
    }
  }
  System.out.println(count);
}
}