import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int count = 0;
		int a = sc.nextInt();
		int b = sc.nextInt();
		for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				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 count = 0;
		int a = sc.nextInt();
		int b = sc.nextInt();
		for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int count = 0;
		int a = sc.nextInt();
		int b = sc.nextInt();
		for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		int count = 0;
		int a = sc.nextInt();
		int b = sc.nextInt();
		for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		}
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = 0; count 0 int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		} {
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		} int digit = String.valueOf(i).length(); digit String.valueOf(i).length() String.valueOf(i).length String.valueOf(i) String.valueOf String i boolean bool = true; bool true for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			} int j = 0; int j = 0; j 0 j <= digit/2 j digit/2 digit 2 j++ j++ j {
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			} {
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			} int low = (int) ((i / Math.pow(10, j)) % 10); low (int) ((i / Math.pow(10, j)) % 10) (i / Math.pow(10, j)) i Math.pow(10, j) Math.pow Math 10 j 10 int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10); up (int) ((i / Math.pow(10, digit - j - 1)) % 10) (i / Math.pow(10, digit - j - 1)) i Math.pow(10, digit - j - 1) Math.pow Math 10 digit - j - 1 digit - j - 1 digit j 1 10 if(!(bool = low == up)) break; !(bool = low == up) (bool = low == up) bool low == up low up break; if(bool) {
				count++;
			} bool {
				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 count = 0;
		int a = sc.nextInt();
		int b = sc.nextInt();
		for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int count = 0;
		int a = sc.nextInt();
		int b = sc.nextInt();
		for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				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 count = 0;
		int a = sc.nextInt();
		int b = sc.nextInt();
		for(int i = a; i <= b; i++){
			int digit = String.valueOf(i).length();
			boolean bool = true;
			for(int j = 0; j <= digit/2; j++){
				int low = (int) ((i / Math.pow(10, j)) % 10);
				int up = (int) ((i / Math.pow(10, digit - j - 1)) % 10);
				if(!(bool = low == up)) break;
			}
			if(bool) {
				count++;
			}
		}
		System.out.println(count);
	}
}