import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int c=0;
int[] d=new int[5]; 
for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
}
System.out.println(c);
}} import java.util.*; util.* java public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int c=0;
int[] d=new int[5]; 
for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
}
System.out.println(c);
}} Main public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int c=0;
int[] d=new int[5]; 
for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
}
System.out.println(c);
} main {
Scanner sc = new Scanner(System.in);
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int c=0;
int[] d=new int[5]; 
for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
}
System.out.println(c);
} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a=Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b=Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int c=0; c 0 int[] d=new int[5]; d new int[5] 5 for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
} int i=a; int i=a; i a i<=b i b i++ i++ i {
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
} {
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
} d[0]=i-i/10*10 d[0] d 0 i-i/10*10 i i/10*10 i/10 i 10 10 d[1]=(i/10*10-i/100*100)/10 d[1] d 1 (i/10*10-i/100*100)/10 (i/10*10-i/100*100) i/10*10 i/10 i 10 10 i/100*100 i/100 i 100 100 10 d[2]=(i/100*100-i/1000*1000)/100 d[2] d 2 (i/100*100-i/1000*1000)/100 (i/100*100-i/1000*1000) i/100*100 i/100 i 100 100 i/1000*1000 i/1000 i 1000 1000 100 d[3]=(i/1000*1000-i/10000*10000)/1000 d[3] d 3 (i/1000*1000-i/10000*10000)/1000 (i/1000*1000-i/10000*10000) i/1000*1000 i/1000 i 1000 1000 i/10000*10000 i/10000 i 10000 10000 1000 d[4]=i/10000 d[4] d 4 i/10000 i 10000 if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;} i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4] i d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4] d[3]*10 d[2]*100 d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4] d[0]*10000 d[0] d 0 10000 d[1]*1000 d[1] d 1 1000 d[2]*100 d[2] d 2 100 d[3]*10 d[3] d 3 10 d[4] d 4 {c++;} c++ c System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int c=0;
int[] d=new int[5]; 
for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
}
System.out.println(c);
}} public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int c=0;
int[] d=new int[5]; 
for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
}
System.out.println(c);
}} Main
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int a=Integer.parseInt(sc.next());
int b=Integer.parseInt(sc.next());
int c=0;
int[] d=new int[5]; 
for(int i=a;i<=b;i++){
d[0]=i-i/10*10;
d[1]=(i/10*10-i/100*100)/10;
d[2]=(i/100*100-i/1000*1000)/100;
d[3]=(i/1000*1000-i/10000*10000)/1000;
d[4]=i/10000;
if(i==d[0]*10000+d[1]*1000+d[2]*100+d[3]*10+d[4]){c++;}
}
System.out.println(c);
}}