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 count = 0;
        int num = a;

        while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        }
        System.out.println(count);


    }
} 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 count = 0;
        int num = a;

        while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        }
        System.out.println(count);


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

        while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        }
        System.out.println(count);


    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        int num = a;

        while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        }
        System.out.println(count);


    } 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 count = 0; count 0 int num = a; num a while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        } num <= b num b {
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        } String numa = String.valueOf(num); numa String.valueOf(num) String.valueOf String num StringBuffer numb = new StringBuffer(numa); numb new StringBuffer(numa) if(numa.contentEquals(numb.reverse())){
                count++;
            } numa.contentEquals(numb.reverse()) numa.contentEquals numa numb.reverse() numb.reverse numb {
                count++;
            } count++ count num++ num 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 sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        int num = a;

        while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        }
        System.out.println(count);


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

        while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        }
        System.out.println(count);


    }
} 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 count = 0;
        int num = a;

        while(num <= b){
            String numa = String.valueOf(num);
            StringBuffer numb = new StringBuffer(numa);

            if(numa.contentEquals(numb.reverse())){
                count++;
            }
            num++;
        }
        System.out.println(count);


    }
}
