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();
		Main main = new Main();
		int ans=0;
		for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		}
		System.out.println(ans);

	}

	public boolean chkPalindrome(String string) {
		int len = string.length();
		int right = len - 1;
		int left = 0;
		while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		}
		return true;
	}

} 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();
		Main main = new Main();
		int ans=0;
		for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		}
		System.out.println(ans);

	}

	public boolean chkPalindrome(String string) {
		int len = string.length();
		int right = len - 1;
		int left = 0;
		while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		}
		return true;
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		Main main = new Main();
		int ans=0;
		for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		}
		System.out.println(ans);

	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		Main main = new Main();
		int ans=0;
		for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		}
		System.out.println(ans);

	} 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 Main main = new Main(); main new Main() int ans=0; ans 0 for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		} int i = A; int i = A; i A i <= B i B i++ i++ i {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		} {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		} String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i if (main.chkPalindrome(s)) {
				ans++;
			} main.chkPalindrome(s) main.chkPalindrome main s {
				ans++;
			} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public boolean chkPalindrome(String string) {
		int len = string.length();
		int right = len - 1;
		int left = 0;
		while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		}
		return true;
	} chkPalindrome {
		int len = string.length();
		int right = len - 1;
		int left = 0;
		while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		}
		return true;
	} int len = string.length(); len string.length() string.length string int right = len - 1; right len - 1 len 1 int left = 0; left 0 while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		} true {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		} if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			} len % 2 == 0 && right < left len % 2 == 0 len % 2 len 2 0 right < left right left {
				break;
			} break; if (len % 2 == 1 && right == left) {
				break;
			} len % 2 == 1 && right == left len % 2 == 1 len % 2 len 2 1 right == left right left {
				break;
			} break; if (string.charAt(left) != string.charAt(right)) {
				return false;
			} string.charAt(left) != string.charAt(right) string.charAt(left) string.charAt string left string.charAt(right) string.charAt string right {
				return false;
			} return false; false left++ left right-- right return true; true String string string public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		Main main = new Main();
		int ans=0;
		for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		}
		System.out.println(ans);

	}

	public boolean chkPalindrome(String string) {
		int len = string.length();
		int right = len - 1;
		int left = 0;
		while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		}
		return true;
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		Main main = new Main();
		int ans=0;
		for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		}
		System.out.println(ans);

	}

	public boolean chkPalindrome(String string) {
		int len = string.length();
		int right = len - 1;
		int left = 0;
		while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		}
		return true;
	}

} 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();
		Main main = new Main();
		int ans=0;
		for (int i = A; i <= B; i++) {
			String s = Integer.toString(i);
			if (main.chkPalindrome(s)) {
				ans++;
			}
		}
		System.out.println(ans);

	}

	public boolean chkPalindrome(String string) {
		int len = string.length();
		int right = len - 1;
		int left = 0;
		while (true) {
			if (len % 2 == 0 && right < left) {
				break;
			} else if (len % 2 == 1 && right == left) {
				break;
			}
			if (string.charAt(left) != string.charAt(right)) {
				return false;
			}
			left++;
			right--;
		}
		return true;
	}

}
