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();
		sc.close();
		
		int ans = 0;
		for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		}
		System.out.println(ans);
	}
} 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();
		sc.close();
		
		int ans = 0;
		for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				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 sc.close() sc.close sc int ans = 0; ans 0 for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		} int i = A; int i = A; i A i <= B i B ++i ++i i {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		} {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		} String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i boolean flag = true; flag true for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			} 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 {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			} {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			} if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				} s.charAt(j) != s.charAt(s.length()-1-j) s.charAt(j) s.charAt s j s.charAt(s.length()-1-j) s.charAt s s.length()-1-j s.length()-1-j s.length() s.length s 1 j {
					flag = false;
					break;
				} flag = false flag false break; if(flag)
				ans++; flag ans++ ans System.out.println(ans) System.out.println System.out System System.out ans 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();
		sc.close();
		
		int ans = 0;
		for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();
		
		int ans = 0;
		for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		}
		System.out.println(ans);
	}
} 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();
		sc.close();
		
		int ans = 0;
		for(int i = A;i <= B;++i) {
			String s = String.valueOf(i);
			boolean flag = true;
			for(int j = 0;j < s.length()/2;++j) {
				if(s.charAt(j) != s.charAt(s.length()-1-j)) {
					flag = false;
					break;
				}
			}
			if(flag)
				ans++;
		}
		System.out.println(ans);
	}
}
