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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		}
		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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		}
		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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		}
		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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		}
		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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		} int i = A; int i = A; i A i <= B i B i++ i++ i {
			String temp = String.valueOf(i);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		} {
			String temp = String.valueOf(i);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		} String temp = String.valueOf(i); temp String.valueOf(i) String.valueOf String i char[] tempList = temp.toCharArray(); tempList temp.toCharArray() temp.toCharArray temp int length = temp.length(); length temp.length() temp.length temp int halfLength = length / 2; halfLength length / 2 length 2 boolean isAllSameNumber = true; isAllSameNumber true if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			} length % 2 == 0 length % 2 length 2 0 {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				} int j = 0 ; int j = 0 ; j 0 j < halfLength+1 j halfLength+1 halfLength 1 j++ j++ j {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				} {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				} if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					} tempList[j] != tempList[length-1-j] tempList[j] tempList j tempList[length-1-j] tempList length-1-j length-1-j length 1 j {
						isAllSameNumber = false;
						break;
					} isAllSameNumber = false isAllSameNumber false break; {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			} for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				} int j = 0; int j = 0; j 0 j < halfLength j halfLength j++ j++ j {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				} {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				} if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					} tempList[j] != tempList[length-1-j] tempList[j] tempList j tempList[length-1-j] tempList length-1-j length-1-j length 1 j {
						isAllSameNumber = false;
						break;
					} isAllSameNumber = false isAllSameNumber false break; if (isAllSameNumber) {
				count = count + 1;
			} isAllSameNumber {
				count = count + 1;
			} count = count + 1 count count + 1 count 1 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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		}
		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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

		}
		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);
			char[] tempList = temp.toCharArray();
			int length = temp.length();
			int halfLength = length / 2;
			boolean isAllSameNumber = true;
			if (length % 2 == 0) {

				for (int j = 0 ; j < halfLength+1; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}
			} else {
				for (int j = 0; j < halfLength ; j++) {
					if (tempList[j] != tempList[length-1-j]) {
						isAllSameNumber = false;
						break;
					}
				}

			}
			if (isAllSameNumber) {
				count = count + 1;
			}

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