import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int c = 0;
        for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        }

        System.out.println(c);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int c = 0;
        for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        }

        System.out.println(c);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int c = 0;
        for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        }

        System.out.println(c);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int c = 0;
        for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        }

        System.out.println(c);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc sc.close() sc.close sc int c = 0; c 0 for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        } {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        } StringBuffer sb = new StringBuffer(String.valueOf(i)); sb new StringBuffer(String.valueOf(i)) String revNum = sb.reverse().toString(); revNum sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb int num = Integer.parseInt(revNum); num Integer.parseInt(revNum) Integer.parseInt Integer revNum if (i == num) {
                c++;
            } i == num i num {
                c++;
            } c++ c System.out.println(c) System.out.println System.out System System.out c String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int c = 0;
        for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        }

        System.out.println(c);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int c = 0;
        for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        }

        System.out.println(c);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        sc.close();

        int c = 0;
        for (int i = a; i <= b; i++) {
            StringBuffer sb = new StringBuffer(String.valueOf(i));
            String revNum = sb.reverse().toString();
            int num = Integer.parseInt(revNum);

            if (i == num) {
                c++;
            }
        }

        System.out.println(c);
    }
}
