import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int sum = 0;
        while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        }
        System.out.println(sum);
    }

    private static boolean isPalindrome(int n1) {
        String str = Integer.toString(n1);
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        return sb.reverse().toString().equals(str);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int sum = 0;
        while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        }
        System.out.println(sum);
    }

    private static boolean isPalindrome(int n1) {
        String str = Integer.toString(n1);
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        return sb.reverse().toString().equals(str);
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int sum = 0;
        while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        }
        System.out.println(sum);
    } main {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int sum = 0;
        while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        }
        System.out.println(sum);
    } Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int n1 = in.nextInt(); n1 in.nextInt() in.nextInt in int n2 = in.nextInt(); n2 in.nextInt() in.nextInt in int sum = 0; sum 0 while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        } n1 <= n2 n1 n2 {
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        } if(isPalindrome(n1)){
                sum++;
            } isPalindrome(n1) isPalindrome n1 {
                sum++;
            } sum++ sum n1++ n1 System.out.println(sum) System.out.println System.out System System.out sum String[] args args private static boolean isPalindrome(int n1) {
        String str = Integer.toString(n1);
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        return sb.reverse().toString().equals(str);
    } isPalindrome {
        String str = Integer.toString(n1);
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        return sb.reverse().toString().equals(str);
    } String str = Integer.toString(n1); str Integer.toString(n1) Integer.toString Integer n1 StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append(str) sb.append sb str return sb.reverse().toString().equals(str); sb.reverse().toString().equals(str) sb.reverse().toString().equals sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb str int n1 n1 public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int sum = 0;
        while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        }
        System.out.println(sum);
    }

    private static boolean isPalindrome(int n1) {
        String str = Integer.toString(n1);
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        return sb.reverse().toString().equals(str);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int sum = 0;
        while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        }
        System.out.println(sum);
    }

    private static boolean isPalindrome(int n1) {
        String str = Integer.toString(n1);
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        return sb.reverse().toString().equals(str);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n1 = in.nextInt();
        int n2 = in.nextInt();
        int sum = 0;
        while (n1 <= n2){
            if(isPalindrome(n1)){
                sum++;
            }
            n1++;
        }
        System.out.println(sum);
    }

    private static boolean isPalindrome(int n1) {
        String str = Integer.toString(n1);
        StringBuilder sb = new StringBuilder();
        sb.append(str);
        return sb.reverse().toString().equals(str);
    }
}