import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        }

        System.out.println(sum);
    }
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        }

        System.out.println(sum);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        }

        System.out.println(sum);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        }

        System.out.println(sum);
    } 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 sum = 0; sum 0 for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        } int i=a; int i=a; i a i<=b i b i++ i++ i {
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        } {
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        } char[] array = String.valueOf(i).toCharArray(); array String.valueOf(i).toCharArray() String.valueOf(i).toCharArray String.valueOf(i) String.valueOf String i int count = 0; count 0 for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            } int j=0; int j=0; j 0 j<array.length - 2 j array.length - 2 array.length array array.length 2 j++ j++ j {
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            } {
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            } int tail = array.length -1 - j; tail array.length -1 - j array.length -1 - j array.length array array.length 1 j if(array[j] == array[tail]){
                    count++;
                } array[j] == array[tail] array[j] array j array[tail] array tail {
                    count++;
                } count++ count if(count == 3){
                sum++;
            } count == 3 count 3 {
                sum++;
            } sum++ sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        }

        System.out.println(sum);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        }

        System.out.println(sum);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int sum = 0;

        for(int i=a; i<=b; i++){
            char[] array = String.valueOf(i).toCharArray();
            int count = 0;
            for(int j=0; j<array.length - 2; j++){
                int tail = array.length -1 - j;
                if(array[j] == array[tail]){
                    count++;
                }
            }
            if(count == 3){
                sum++;
            }
        }

        System.out.println(sum);
    }
}
