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;

        for (int i = a; i < b + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                count++;
            }
        }

        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;

        for (int i = a; i < b + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                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 + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                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 + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                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 + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                count++;
            }
        } int i = a; int i = a; i a i < b + 1 i b + 1 b 1 i++ i++ i {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                count++;
            }
        } {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                count++;
            }
        } int i1 = i / 10000; i1 i / 10000 i 10000 int i2 = (i % 10000) / 1000; i2 (i % 10000) / 1000 (i % 10000) i 10000 1000 int i4 = (i % 100) / 10; i4 (i % 100) / 10 (i % 100) i 100 10 int i5 = i % 10; i5 i % 10 i 10 if (i1 == i5 && i2 == i4) {
                count++;
            } i1 == i5 && i2 == i4 i1 == i5 i1 i5 i2 == i4 i2 i4 {
                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 sc = new Scanner(System.in);

        int a = sc.nextInt();
        int b = sc.nextInt();

        int count = 0;

        for (int i = a; i < b + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                count++;
            }
        }

        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;

        for (int i = a; i < b + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                count++;
            }
        }

        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;

        for (int i = a; i < b + 1; i++) {
            int i1 = i / 10000;
            int i2 = (i % 10000) / 1000;
            int i4 = (i % 100) / 10;
            int i5 = i % 10;
            if (i1 == i5 && i2 == i4) {
                count++;
            }
        }

        System.out.println(count);
    }
}
