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

public class Main {
    public static void main(String[] args)throws  Exception{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int a = Integer.parseInt(tokenizer.nextToken());
        int b = Integer.parseInt(tokenizer.nextToken());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        }
        System.out.println(count);
    }

    public static boolean isBlandrome(int n){
        int copy = n;

        int newN = 0;

        while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        }

        if (n > 0){
            newN = newN * 10 + (n % 10);
        }

        return  newN == copy;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    public static void main(String[] args)throws  Exception{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int a = Integer.parseInt(tokenizer.nextToken());
        int b = Integer.parseInt(tokenizer.nextToken());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        }
        System.out.println(count);
    }

    public static boolean isBlandrome(int n){
        int copy = n;

        int newN = 0;

        while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        }

        if (n > 0){
            newN = newN * 10 + (n % 10);
        }

        return  newN == copy;
    }
} Main public static void main(String[] args)throws  Exception{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int a = Integer.parseInt(tokenizer.nextToken());
        int b = Integer.parseInt(tokenizer.nextToken());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        }
        System.out.println(count);
    } main {
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int a = Integer.parseInt(tokenizer.nextToken());
        int b = Integer.parseInt(tokenizer.nextToken());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        }
        System.out.println(count);
    } BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) StringTokenizer tokenizer = new StringTokenizer(input.readLine()); tokenizer new StringTokenizer(input.readLine()) int a = Integer.parseInt(tokenizer.nextToken()); a Integer.parseInt(tokenizer.nextToken()) Integer.parseInt Integer tokenizer.nextToken() tokenizer.nextToken tokenizer int b = Integer.parseInt(tokenizer.nextToken()); b Integer.parseInt(tokenizer.nextToken()) Integer.parseInt Integer tokenizer.nextToken() tokenizer.nextToken tokenizer int count = 0; count 0 for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            if (isBlandrome(i))
                count++;
        } {
            if (isBlandrome(i))
                count++;
        } if (isBlandrome(i))
                count++; isBlandrome(i) isBlandrome i count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean isBlandrome(int n){
        int copy = n;

        int newN = 0;

        while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        }

        if (n > 0){
            newN = newN * 10 + (n % 10);
        }

        return  newN == copy;
    } isBlandrome {
        int copy = n;

        int newN = 0;

        while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        }

        if (n > 0){
            newN = newN * 10 + (n % 10);
        }

        return  newN == copy;
    } int copy = n; copy n int newN = 0; newN 0 while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        } n > 9 n 9 {
            newN = newN * 10 + (n % 10);
            n /= 10;
        } newN = newN * 10 + (n % 10) newN newN * 10 + (n % 10) newN * 10 newN 10 (n % 10) n 10 n /= 10 n 10 if (n > 0){
            newN = newN * 10 + (n % 10);
        } n > 0 n 0 {
            newN = newN * 10 + (n % 10);
        } newN = newN * 10 + (n % 10) newN newN * 10 + (n % 10) newN * 10 newN 10 (n % 10) n 10 return  newN == copy; newN == copy newN copy int n n public class Main {
    public static void main(String[] args)throws  Exception{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int a = Integer.parseInt(tokenizer.nextToken());
        int b = Integer.parseInt(tokenizer.nextToken());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        }
        System.out.println(count);
    }

    public static boolean isBlandrome(int n){
        int copy = n;

        int newN = 0;

        while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        }

        if (n > 0){
            newN = newN * 10 + (n % 10);
        }

        return  newN == copy;
    }
} public class Main {
    public static void main(String[] args)throws  Exception{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int a = Integer.parseInt(tokenizer.nextToken());
        int b = Integer.parseInt(tokenizer.nextToken());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        }
        System.out.println(count);
    }

    public static boolean isBlandrome(int n){
        int copy = n;

        int newN = 0;

        while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        }

        if (n > 0){
            newN = newN * 10 + (n % 10);
        }

        return  newN == copy;
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args)throws  Exception{
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(input.readLine());
        int a = Integer.parseInt(tokenizer.nextToken());
        int b = Integer.parseInt(tokenizer.nextToken());
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isBlandrome(i))
                count++;
        }
        System.out.println(count);
    }

    public static boolean isBlandrome(int n){
        int copy = n;

        int newN = 0;

        while (n > 9){
            newN = newN * 10 + (n % 10);
            n /= 10;
        }

        if (n > 0){
            newN = newN * 10 + (n % 10);
        }

        return  newN == copy;
    }
}
