import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int cnt = 0;
        for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        }
        System.out.println(cnt);
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int cnt = 0;
        for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        }
        System.out.println(cnt);
    }
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int cnt = 0;
        for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        }
        System.out.println(cnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int cnt = 0;
        for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        }
        System.out.println(cnt);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int x = Integer.parseInt(sc.next()); x Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int y = Integer.parseInt(sc.next()); y Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int cnt = 0; cnt 0 for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        } int i = x; int i = x; i x i <= y i y i++ i++ i {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        } {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        } String num = Integer.toString(i); num Integer.toString(i) Integer.toString Integer i boolean isKaibun = true; isKaibun true for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            } int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            } {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            } if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                } num.charAt(j) != num.charAt(4 - j) num.charAt(j) num.charAt num j num.charAt(4 - j) num.charAt num 4 - j 4 j {
                    isKaibun = false;
                } isKaibun = false isKaibun false if (isKaibun) cnt++; isKaibun cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int cnt = 0;
        for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        }
        System.out.println(cnt);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int cnt = 0;
        for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        }
        System.out.println(cnt);
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        int cnt = 0;
        for (int i = x; i <= y; i++) {
            String num = Integer.toString(i);
            boolean isKaibun = true;
            for (int j = 0; j < 2; j++) {
                if (num.charAt(j) != num.charAt(4 - j) ) {
                    isKaibun = false;
                }
            }
            if (isKaibun) cnt++;
        }
        System.out.println(cnt);
    }
}
