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 sum = 0;
        for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        }

        System.out.println(sum);
    }
} 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 sum = 0;
        for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        }

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

        int sum = 0;
        for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        }

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

        int sum = 0;
        for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        }

        System.out.println(sum);
    } 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 sum = 0; sum 0 for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        } {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        } String is = String.valueOf(i); is String.valueOf(i) String.valueOf String i boolean flag = true; flag true for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	} int j = 0; int j = 0; j 0 j < is.length()/2 j is.length()/2 is.length() is.length is 2 j++ j++ j {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	} {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	} flag = flag && is.charAt(j) == is.charAt(is.length()-j-1) flag flag && is.charAt(j) == is.charAt(is.length()-j-1) flag is.charAt(j) == is.charAt(is.length()-j-1) is.charAt(j) is.charAt is j is.charAt(is.length()-j-1) is.charAt is is.length()-j-1 is.length()-j-1 is.length() is.length is j 1 sum += flag ? 1 : 0 sum flag ? 1 : 0 flag 1 0 System.out.println(sum) System.out.println System.out System System.out sum 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 sum = 0;
        for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        }

        System.out.println(sum);
    }
} public class Main {

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

        int sum = 0;
        for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        }

        System.out.println(sum);
    }
} 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 sum = 0;
        for(int i = a;i <= b;i++) {
        	String is = String.valueOf(i);

        	boolean flag = true;
        	for(int j = 0;j < is.length()/2;j++) {
        		flag = flag && is.charAt(j) == is.charAt(is.length()-j-1);
        	}

        	sum += flag ? 1 : 0;
        }

        System.out.println(sum);
    }
}
