import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        Scanner scn= new Scanner(System.in);
        int start= scn.nextInt();
        int end = scn.nextInt();
        int answer = 0;
        for(int i=start;i<=end;i++){
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        }
        System.out.println(answer);
    }
} import java.util.Scanner; Scanner java.util class Main{
    public static void main(String[] args) {
        Scanner scn= new Scanner(System.in);
        int start= scn.nextInt();
        int end = scn.nextInt();
        int answer = 0;
        for(int i=start;i<=end;i++){
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        }
        System.out.println(answer);
    }
} Main public static void main(String[] args) {
        Scanner scn= new Scanner(System.in);
        int start= scn.nextInt();
        int end = scn.nextInt();
        int answer = 0;
        for(int i=start;i<=end;i++){
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        }
        System.out.println(answer);
    } main {
        Scanner scn= new Scanner(System.in);
        int start= scn.nextInt();
        int end = scn.nextInt();
        int answer = 0;
        for(int i=start;i<=end;i++){
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        }
        System.out.println(answer);
    } Scanner scn= new Scanner(System.in); scn new Scanner(System.in) int start= scn.nextInt(); start scn.nextInt() scn.nextInt scn int end = scn.nextInt(); end scn.nextInt() scn.nextInt scn int answer = 0; answer 0 for(int i=start;i<=end;i++){
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        } int i=start; int i=start; i start i<=end i end i++ i++ i {
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        } {
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        } String buf = String.valueOf(i); buf String.valueOf(i) String.valueOf String i for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            } int j=0; int j=0; j 0 j<buf.length()/2 j buf.length()/2 buf.length() buf.length buf 2 j++ j++ j {
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            } {
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            } char r = buf.charAt(j); r buf.charAt(j) buf.charAt buf j char l = buf.charAt(buf.length()-1-j); l buf.charAt(buf.length()-1-j) buf.charAt buf buf.length()-1-j buf.length()-1-j buf.length() buf.length buf 1 j if(r!=l){
                    answer--;
                    break;
                } r!=l r l {
                    answer--;
                    break;
                } answer-- answer break; answer++ answer System.out.println(answer) System.out.println System.out System System.out answer String[] args args
import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        Scanner scn= new Scanner(System.in);
        int start= scn.nextInt();
        int end = scn.nextInt();
        int answer = 0;
        for(int i=start;i<=end;i++){
            String buf = String.valueOf(i);
            for(int j=0;j<buf.length()/2;j++){
                char r = buf.charAt(j);
                char l = buf.charAt(buf.length()-1-j);
                if(r!=l){
                    answer--;
                    break;
                }
            }
            answer++;
        }
        System.out.println(answer);
    }
}
