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 ans = 0;

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

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

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

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

        sc.close();

        int ans = 0;

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

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

        sc.close();

        int ans = 0;

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

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

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

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

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

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

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

        System.out.println(ans);
    }
}