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 result = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        }
        System.out.println(result);
    }
} 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 result = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        }
        System.out.println(result);
    }
} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        }
        System.out.println(result);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int result = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        }
        System.out.println(result);
    } 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 result = 0; result 0 for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        } {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        } String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i String before = s.substring(0, 2); before s.substring(0, 2) s.substring s 0 2 String after = s.substring(4, 5) + s.substring(3, 4); after s.substring(4, 5) + s.substring(3, 4) s.substring(4, 5) s.substring s 4 5 s.substring(3, 4) s.substring s 3 4 if (before.equals(after)) {
                result++;
            } before.equals(after) before.equals before after {
                result++;
            } result++ result System.out.println(result) System.out.println System.out System System.out result 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 result = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            String before = s.substring(0, 2);
            String after = s.substring(4, 5) + s.substring(3, 4);
            if (before.equals(after)) {
                result++;
            }
        }
        System.out.println(result);
    }
}