import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int start = sc.nextInt();
    	int end = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		}
    	System.out.println(ans);
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int start = sc.nextInt();
    	int end = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		}
    	System.out.println(ans);
    }

} Main public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int start = sc.nextInt();
    	int end = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		}
    	System.out.println(ans);
    } main {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int start = sc.nextInt();
    	int end = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		}
    	System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int start = sc.nextInt(); start sc.nextInt() sc.nextInt sc int end = sc.nextInt(); end sc.nextInt() sc.nextInt sc sc.close() sc.close sc int ans = 0; ans 0 for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		} int i = start; int i = start; i start i <= end i end i++ i++ i {
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		} {
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		} String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i String str2 = str.substring(4, 5) + str.substring(3, 4); str2 str.substring(4, 5) + str.substring(3, 4) str.substring(4, 5) str.substring str 4 5 str.substring(3, 4) str.substring str 3 4 if(str.substring(0, 2).equals(str2)) ans++; str.substring(0, 2).equals(str2) str.substring(0, 2).equals str.substring(0, 2) str.substring str 0 2 str2 ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int start = sc.nextInt();
    	int end = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		}
    	System.out.println(ans);
    }

} public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int start = sc.nextInt();
    	int end = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		}
    	System.out.println(ans);
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int start = sc.nextInt();
    	int end = sc.nextInt();
    	sc.close();
    	int ans = 0;
    	for(int i = start; i <= end; i++){
    		String str = String.valueOf(i);
    		String str2 = str.substring(4, 5) + str.substring(3, 4);
    		if(str.substring(0, 2).equals(str2)) ans++;
		}
    	System.out.println(ans);
    }

}
