import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

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

        int count = 0;
        for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }

} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {

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

        int count = 0;
        for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }

} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();

        int count = 0;
        for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        String b = sc.next();

        int count = 0;
        for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.next(); a sc.next() sc.next sc String b = sc.next(); b sc.next() sc.next sc int count = 0; count 0 for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        } int i = Integer.parseInt(a); int i = Integer.parseInt(a); i Integer.parseInt(a) Integer.parseInt Integer a i <= Integer.parseInt(b) i Integer.parseInt(b) Integer.parseInt Integer b i++ i++ i {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        } {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        } List<String> iList = Arrays.asList(String.valueOf(i).split("")); iList Arrays.asList(String.valueOf(i).split("")) Arrays.asList Arrays String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" List<String> reverseList = new ArrayList<>(); reverseList new ArrayList<>() for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            } int j = iList.size() - 1; int j = iList.size() - 1; j iList.size() - 1 iList.size() iList.size iList 1 j >= 0 j 0 j-- j-- j {
                reverseList.add(String.valueOf(iList.get(j)));
            } {
                reverseList.add(String.valueOf(iList.get(j)));
            } reverseList.add(String.valueOf(iList.get(j))) reverseList.add reverseList String.valueOf(iList.get(j)) String.valueOf String iList.get(j) iList.get iList j for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            } int j = 0; int j = 0; j 0 j < iList.size() j iList.size() iList.size iList j++ j++ j {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            } {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            } if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                } !iList.get(j).equals(reverseList.get(j)) iList.get(j).equals(reverseList.get(j)) iList.get(j).equals iList.get(j) iList.get iList j reverseList.get(j) reverseList.get reverseList j {
                    break;
                } break; if (j == iList.size() - 1) {
                    count++;
                } j == iList.size() - 1 j iList.size() - 1 iList.size() iList.size iList 1 {
                    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);
        String a = sc.next();
        String b = sc.next();

        int count = 0;
        for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }

} public class Main {

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

        int count = 0;
        for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }

} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {

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

        int count = 0;
        for (int i = Integer.parseInt(a); i <= Integer.parseInt(b); i++) {
            List<String> iList = Arrays.asList(String.valueOf(i).split(""));
            List<String> reverseList = new ArrayList<>();
            for (int j = iList.size() - 1; j >= 0; j--) {
                reverseList.add(String.valueOf(iList.get(j)));
            }
            for (int j = 0; j < iList.size(); j++) {
                if (!iList.get(j).equals(reverseList.get(j))) {
                    break;
                }
                if (j == iList.size() - 1) {
                    count++;
                }
            }
        }
        System.out.println(count);
    }

}
