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)) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;
        String nString = Integer.toString(n);

        for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            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)) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;
        String nString = Integer.toString(n);

        for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            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)) 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)) 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)) count++;
        } int i = min; int i = min; i min i <= max i max i++ i++ i {
            if (isKaibun(i)) count++;
        } {
            if (isKaibun(i)) count++;
        } if (isKaibun(i)) count++; isKaibun(i) isKaibun i 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;
        String nString = Integer.toString(n);

        for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            isKaibun = false;
            break;
        }

        return isKaibun;
    } isKaibun {
        boolean isKaibun = true;
        String nString = Integer.toString(n);

        for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            isKaibun = false;
            break;
        }

        return isKaibun;
    } boolean isKaibun = true; isKaibun true String nString = Integer.toString(n); nString Integer.toString(n) Integer.toString Integer n for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            isKaibun = false;
            break;
        } int i = 0; int i = 0; i 0 i < nString.length() i nString.length() nString.length nString i++ i++ i {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            isKaibun = false;
            break;
        } {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            isKaibun = false;
            break;
        } if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue; nString.charAt(i) == nString.charAt(nString.length()-1-i) nString.charAt(i) nString.charAt nString i nString.charAt(nString.length()-1-i) nString.charAt nString nString.length()-1-i nString.length()-1-i nString.length() nString.length nString 1 i continue; 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)) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;
        String nString = Integer.toString(n);

        for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            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)) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;
        String nString = Integer.toString(n);

        for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            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)) count++;
        }

        System.out.println(count);
    }

    private static boolean isKaibun(int n) {
        boolean isKaibun = true;
        String nString = Integer.toString(n);

        for (int i = 0; i < nString.length(); i++) {
            if (nString.charAt(i) == nString.charAt(nString.length()-1-i)) continue;

            // 文字が違うため回文ではない
            isKaibun = false;
            break;
        }

        return isKaibun;
    }
}
