
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    scan.close();
	    int cnt=0;
	    for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    }
	    System.out.println(cnt);
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    scan.close();
	    int cnt=0;
	    for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    }
	    System.out.println(cnt);
	}

} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    scan.close();
	    int cnt=0;
	    for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    }
	    System.out.println(cnt);
	} main {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    scan.close();
	    int cnt=0;
	    for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    }
	    System.out.println(cnt);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan scan.close() scan.close scan int cnt=0; cnt 0 for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    } int i=a; int i=a; i a i<=b i b i++ i++ i {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    } {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    } String s = String.valueOf(i) ; s String.valueOf(i) String.valueOf String i for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	} int j=0; int j=0; j 0 j<s.length()/2 j s.length()/2 s.length() s.length s 2 j++ j++ j {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	} {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	} int x = Character.getNumericValue(s.charAt(j)); x Character.getNumericValue(s.charAt(j)) Character.getNumericValue Character s.charAt(j) s.charAt s j int y = Character.getNumericValue(s.charAt(s.length()-1-j)); y Character.getNumericValue(s.charAt(s.length()-1-j)) Character.getNumericValue Character s.charAt(s.length()-1-j) s.charAt s s.length()-1-j s.length()-1-j s.length() s.length s 1 j if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++; x!=y x y break; if(j==s.length()/2-1)cnt++; j==s.length()/2-1 j s.length()/2-1 s.length()/2 s.length() s.length s 2 1 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) {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    scan.close();
	    int cnt=0;
	    for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    }
	    System.out.println(cnt);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    scan.close();
	    int cnt=0;
	    for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    }
	    System.out.println(cnt);
	}

} Main

import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int a = scan.nextInt();
	    int b = scan.nextInt();
	    scan.close();
	    int cnt=0;
	    for(int i=a;i<=b;i++) {
	    	String s = String.valueOf(i) ;
	    	for(int j=0;j<s.length()/2;j++) {
	    		int x = Character.getNumericValue(s.charAt(j));
	    		int y = Character.getNumericValue(s.charAt(s.length()-1-j));
	    		if(x!=y)break;
	    		else if(j==s.length()/2-1)cnt++;

	    	}
	    }
	    System.out.println(cnt);
	}

}