import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int A = cin.nextInt();
        int B = cin.nextInt();
        int cnt = 0;
        for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        }

        System.out.println(cnt);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int A = cin.nextInt();
        int B = cin.nextInt();
        int cnt = 0;
        for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        }

        System.out.println(cnt);
    }
} Main public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int A = cin.nextInt();
        int B = cin.nextInt();
        int cnt = 0;
        for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        }

        System.out.println(cnt);
    } main {
        Scanner cin = new Scanner(System.in);
        int A = cin.nextInt();
        int B = cin.nextInt();
        int cnt = 0;
        for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        }

        System.out.println(cnt);
    } Scanner cin = new Scanner(System.in); cin new Scanner(System.in) int A = cin.nextInt(); A cin.nextInt() cin.nextInt cin int B = cin.nextInt(); B cin.nextInt() cin.nextInt cin int cnt = 0; cnt 0 for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        } int i = A; int i = A; i A i <= B i B i++ i++ i {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        } {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        } int n = i; n i int a = n % 10; a n % 10 n 10 n /= 10 n 10 int b = n % 10; b n % 10 n 10 n /= 10 n 10 n /= 10 n 10 int d = n % 10; d n % 10 n 10 n /= 10 n 10 int e = n % 10; e n % 10 n 10 if (a == e && b == d) {
                cnt++;
            } a == e && b == d a == e a e b == d b d {
                cnt++;
            } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int A = cin.nextInt();
        int B = cin.nextInt();
        int cnt = 0;
        for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        }

        System.out.println(cnt);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int A = cin.nextInt();
        int B = cin.nextInt();
        int cnt = 0;
        for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        }

        System.out.println(cnt);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int A = cin.nextInt();
        int B = cin.nextInt();
        int cnt = 0;
        for (int i = A; i <= B; i++) {
            int n = i;
            int a = n % 10; n /= 10;
            int b = n % 10; n /= 10;
            n /= 10;
            int d = n % 10; n /= 10;
            int e = n % 10;

            if (a == e && b == d) {
                cnt++;
            }
        }

        System.out.println(cnt);
    }
}