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();

        int count = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        }

        System.out.println(count);
    }
} 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();

        int count = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        }

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

        int count = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        }

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

        int count = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        }

        System.out.println(count);
    } 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 int count = 0; count 0 for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        } {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        } String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            } new StringBuilder(s).reverse().toString().equals(s) new StringBuilder(s).reverse().toString().equals new StringBuilder(s).reverse().toString() new StringBuilder(s).reverse().toString new StringBuilder(s).reverse() new StringBuilder(s).reverse new StringBuilder(s) s {
                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);
        int a = sc.nextInt();
        int b = sc.nextInt();

        int count = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        }

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

        int count = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        }

        System.out.println(count);
    }
} 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();

        int count = 0;
        for (int i = a; i <= b; i++) {
            String s = String.valueOf(i);
            if (new StringBuilder(s).reverse().toString().equals(s)) {
                count++;
            }
        }

        System.out.println(count);
    }
}
