import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int A = s.nextInt();
        int B = s.nextInt();

        int count = 0;
        for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        }
        System.out.println(count);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int A = s.nextInt();
        int B = s.nextInt();

        int count = 0;
        for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int A = s.nextInt();
        int B = s.nextInt();

        int count = 0;
        for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        }
        System.out.println(count);
    } main {
        Scanner s = new Scanner(System.in);
        int A = s.nextInt();
        int B = s.nextInt();

        int count = 0;
        for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        }
        System.out.println(count);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int A = s.nextInt(); A s.nextInt() s.nextInt s int B = s.nextInt(); B s.nextInt() s.nextInt s int count = 0; count 0 for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        } int i = A; int i = A; i A i <= B i B i++ i++ i {
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        } {
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        } String start = String.valueOf(i); start String.valueOf(i) String.valueOf String i char[] a = start.toCharArray(); a start.toCharArray() start.toCharArray start String reverceA = ""; reverceA "" for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            } int j = start.length(); int j = start.length(); j start.length() start.length start j != 0 j 0 j-- j-- j {
                reverceA += a[j - 1];
            } {
                reverceA += a[j - 1];
            } reverceA += a[j - 1] reverceA a[j - 1] a j - 1 j 1 if(start.equals(reverceA)){
                count ++;
            } start.equals(reverceA) start.equals start reverceA {
                count ++;
            } count ++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int A = s.nextInt();
        int B = s.nextInt();

        int count = 0;
        for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        }
        System.out.println(count);
    }
} public class Main {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int A = s.nextInt();
        int B = s.nextInt();

        int count = 0;
        for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        }
        System.out.println(count);
    }
} Main
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        int A = s.nextInt();
        int B = s.nextInt();

        int count = 0;
        for (int i = A; i <= B; i++){
            String start = String.valueOf(i);
            char[] a = start.toCharArray();
            String reverceA = "";
            for (int j = start.length(); j != 0; j--) {
                reverceA += a[j - 1];
            }

            if(start.equals(reverceA)){
                count ++;
            }
        }
        System.out.println(count);
    }
}
