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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				count ++;
			}
		} int i=A; int i=A; i A i<=B i B i++ i++ i {
			String temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				count ++;
			}
		} {
			String temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				count ++;
			}
		} String temp = String.valueOf(i); temp String.valueOf(i) String.valueOf String i boolean b = true; b true for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			} int j=0; int j=0; j 0 j<2 j 2 j++ j++ j {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			} {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			} if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				} temp.charAt(j)!=temp.charAt(temp.length()-j-1) temp.charAt(j) temp.charAt temp j temp.charAt(temp.length()-j-1) temp.charAt temp temp.length()-j-1 temp.length()-j-1 temp.length() temp.length temp j 1 {
					b=false;
					break;
				} b=false b false break; if (b==true) {
				count ++;
			} b==true b true {
				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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				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 temp = String.valueOf(i);
			boolean b = true;
			for (int j=0;j<2;j++) {
				if (temp.charAt(j)!=temp.charAt(temp.length()-j-1)) {
					b=false;
					break;
				}
			}
			if (b==true) {
				count ++;
			}
		}
		System.out.println(count);
	}
}