import java.util.*;

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;
        for(int i = a;i <= b;i++){
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        }
        System.out.println(count);
    }
} import java.util.*; util.* java 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;
        for(int i = a;i <= b;i++){
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        }
        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;
        for(int i = a;i <= b;i++){
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for(int i = a;i <= b;i++){
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        }
        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 for(int i = a;i <= b;i++){
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        } {
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i StringBuffer sb = new StringBuffer(str); sb new StringBuffer(str) String rev = sb.reverse().toString(); rev sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb if(str.equals(rev))
                count++; str.equals(rev) str.equals str rev count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;

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;
        for(int i = a;i <= b;i++){
            String str = String.valueOf(i);
            StringBuffer sb = new StringBuffer(str);
            String rev = sb.reverse().toString();
            if(str.equals(rev))
                count++;
        }
        System.out.println(count);
    }
}