import java.util.*;

public class Main {

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

        int count = 0;
        for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;

        char[] nCharArr = Integer.valueOf(n).toString().toCharArray();
        for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        }

        return isKaibun;
    }
} import java.util.*; util.* java public class Main {

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

        int count = 0;
        for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;

        char[] nCharArr = Integer.valueOf(n).toString().toCharArray();
        for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        }

        return isKaibun;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int min = sc.nextInt();
        int max = sc.nextInt();

        int count = 0;
        for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        }

        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int min = sc.nextInt();
        int max = sc.nextInt();

        int count = 0;
        for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        }

        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min = sc.nextInt(); min sc.nextInt() sc.nextInt sc int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc int count = 0; count 0 for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        } int i = min; int i = min; i min i <= max i max i++ i++ i {
            if (isKaibun(i) == true) count++;
        } {
            if (isKaibun(i) == true) count++;
        } if (isKaibun(i) == true) count++; isKaibun(i) == true isKaibun(i) isKaibun i true count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args private static boolean isKaibun(int n) {
        boolean isKaibun = true;

        char[] nCharArr = Integer.valueOf(n).toString().toCharArray();
        for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        }

        return isKaibun;
    } isKaibun {
        boolean isKaibun = true;

        char[] nCharArr = Integer.valueOf(n).toString().toCharArray();
        for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        }

        return isKaibun;
    } boolean isKaibun = true; isKaibun true char[] nCharArr = Integer.valueOf(n).toString().toCharArray(); nCharArr Integer.valueOf(n).toString().toCharArray() Integer.valueOf(n).toString().toCharArray Integer.valueOf(n).toString() Integer.valueOf(n).toString Integer.valueOf(n) Integer.valueOf Integer n for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        } int i = 0; int i = 0; i 0 i < nCharArr.length i nCharArr.length nCharArr nCharArr.length i++ i++ i {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        } {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        } if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            } nCharArr[i] != nCharArr[nCharArr.length - i - 1] nCharArr[i] nCharArr i nCharArr[nCharArr.length - i - 1] nCharArr nCharArr.length - i - 1 nCharArr.length - i - 1 nCharArr.length nCharArr nCharArr.length i 1 {
                isKaibun = false;
                break;
            } isKaibun = false isKaibun false break; return isKaibun; isKaibun int n n public class Main {

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

        int count = 0;
        for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;

        char[] nCharArr = Integer.valueOf(n).toString().toCharArray();
        for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        }

        return isKaibun;
    }
} public class Main {

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

        int count = 0;
        for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;

        char[] nCharArr = Integer.valueOf(n).toString().toCharArray();
        for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        }

        return isKaibun;
    }
} Main
import java.util.*;

public class Main {

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

        int count = 0;
        for (int i = min; i <= max; i++) {
            if (isKaibun(i) == true) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;

        char[] nCharArr = Integer.valueOf(n).toString().toCharArray();
        for (int i = 0; i < nCharArr.length; i++) {
            if (nCharArr[i] != nCharArr[nCharArr.length - i - 1]) {
                isKaibun = false;
                break;
            }
        }

        return isKaibun;
    }
}
