import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int counter = 0;

        for(int i = A; i <= B; i++){
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        }


        System.out.println(counter);
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int counter = 0;

        for(int i = A; i <= B; i++){
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        }


        System.out.println(counter);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int counter = 0;

        for(int i = A; i <= B; i++){
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        }


        System.out.println(counter);
    } main {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int counter = 0;

        for(int i = A; i <= B; i++){
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        }


        System.out.println(counter);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int counter = 0; counter 0 for(int i = A; i <= B; i++){
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        } int i = A; int i = A; i A i <= B i B i++ i++ i {
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        } {
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i StringBuffer rstr = new StringBuffer(str); rstr new StringBuffer(str) rstr.reverse() rstr.reverse rstr if(str.equals(rstr.toString())){
                counter++;
            } str.equals(rstr.toString()) str.equals str rstr.toString() rstr.toString rstr {
                counter++;
            } counter++ counter System.out.println(counter) System.out.println System.out System System.out counter String[] args args
import java.util.*;
import java.lang.*;
import java.io.*;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int counter = 0;

        for(int i = A; i <= B; i++){
            String str = String.valueOf(i);
            StringBuffer rstr = new StringBuffer(str);
            rstr.reverse();

            if(str.equals(rstr.toString())){
                counter++;
            }
        }


        System.out.println(counter);
    }
}