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 ans = solve(A, B);
        System.out.println(ans);
    }

    private static int solve(int A, int B) {
        int count = 0;

        for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        }

        return count;
    }

    private static boolean isPalindrome(int N) {
        if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true;
        
        return false;
    }
} 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 ans = solve(A, B);
        System.out.println(ans);
    }

    private static int solve(int A, int B) {
        int count = 0;

        for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        }

        return count;
    }

    private static boolean isPalindrome(int N) {
        if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true;
        
        return false;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = solve(A, B);
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = solve(A, B);
        System.out.println(ans);
    } 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 ans = solve(A, B); ans solve(A, B) solve A B System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static int solve(int A, int B) {
        int count = 0;

        for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        }

        return count;
    } solve {
        int count = 0;

        for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        }

        return count;
    } int count = 0; count 0 for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        } int i=A; int i=A; i A i<=B i B i++ i++ i {
            if(isPalindrome(i)) count++;
        } {
            if(isPalindrome(i)) count++;
        } if(isPalindrome(i)) count++; isPalindrome(i) isPalindrome i count++ count return count; count int A A int B B private static boolean isPalindrome(int N) {
        if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true;
        
        return false;
    } isPalindrome {
        if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true;
        
        return false;
    } if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true; N/10000 == N%10 && (N/1000)%10 == (N/10)%10 N/10000 == N%10 N/10000 N 10000 N%10 N 10 (N/1000)%10 == (N/10)%10 (N/1000)%10 (N/1000) N 1000 10 (N/10)%10 (N/10) N 10 10 return true; true return false; false int N N public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = solve(A, B);
        System.out.println(ans);
    }

    private static int solve(int A, int B) {
        int count = 0;

        for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        }

        return count;
    }

    private static boolean isPalindrome(int N) {
        if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true;
        
        return false;
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();

        int ans = solve(A, B);
        System.out.println(ans);
    }

    private static int solve(int A, int B) {
        int count = 0;

        for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        }

        return count;
    }

    private static boolean isPalindrome(int N) {
        if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true;
        
        return false;
    }
} 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 ans = solve(A, B);
        System.out.println(ans);
    }

    private static int solve(int A, int B) {
        int count = 0;

        for (int i=A; i<=B; i++) {
            if(isPalindrome(i)) count++;
        }

        return count;
    }

    private static boolean isPalindrome(int N) {
        if (N/10000 == N%10 && (N/1000)%10 == (N/10)%10) return true;
        
        return false;
    }
}