import java.util.Scanner;

public class Main {
	
	public static boolean palindromic(int t) {
		String ans = String.valueOf(t);
		int n = ans.length();
		for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		}
		return true;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int ans = 0;
		sc.close();
		for(int i = a; i <= b; ++i) {
			if(palindromic(i))++ans;
		}
		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	
	public static boolean palindromic(int t) {
		String ans = String.valueOf(t);
		int n = ans.length();
		for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		}
		return true;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int ans = 0;
		sc.close();
		for(int i = a; i <= b; ++i) {
			if(palindromic(i))++ans;
		}
		System.out.println(ans);
	}

} Main public static boolean palindromic(int t) {
		String ans = String.valueOf(t);
		int n = ans.length();
		for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		}
		return true;
	} palindromic {
		String ans = String.valueOf(t);
		int n = ans.length();
		for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		}
		return true;
	} String ans = String.valueOf(t); ans String.valueOf(t) String.valueOf String t int n = ans.length(); n ans.length() ans.length ans for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		} int i = 0; int i = 0; i 0 i < n / 2 i n / 2 n 2 ++i ++i i {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		} {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		} if(ans.charAt(i) != ans.charAt(n - i - 1))return false; ans.charAt(i) != ans.charAt(n - i - 1) ans.charAt(i) ans.charAt ans i ans.charAt(n - i - 1) ans.charAt ans n - i - 1 n - i - 1 n i 1 return false; false return true; true int t t public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int ans = 0;
		sc.close();
		for(int i = a; i <= b; ++i) {
			if(palindromic(i))++ans;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int ans = 0;
		sc.close();
		for(int i = a; i <= b; ++i) {
			if(palindromic(i))++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 b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int ans = 0; ans 0 sc.close() sc.close sc for(int i = a; i <= b; ++i) {
			if(palindromic(i))++ans;
		} int i = a; int i = a; i a i <= b i b ++i ++i i {
			if(palindromic(i))++ans;
		} {
			if(palindromic(i))++ans;
		} if(palindromic(i))++ans; palindromic(i) palindromic i ++ans ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	
	public static boolean palindromic(int t) {
		String ans = String.valueOf(t);
		int n = ans.length();
		for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		}
		return true;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int ans = 0;
		sc.close();
		for(int i = a; i <= b; ++i) {
			if(palindromic(i))++ans;
		}
		System.out.println(ans);
	}

} public class Main {
	
	public static boolean palindromic(int t) {
		String ans = String.valueOf(t);
		int n = ans.length();
		for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		}
		return true;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int ans = 0;
		sc.close();
		for(int i = a; i <= b; ++i) {
			if(palindromic(i))++ans;
		}
		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {
	
	public static boolean palindromic(int t) {
		String ans = String.valueOf(t);
		int n = ans.length();
		for(int i = 0; i < n / 2; ++i) {
			if(ans.charAt(i) != ans.charAt(n - i - 1))return false;
		}
		return true;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt(), b = sc.nextInt();
		int ans = 0;
		sc.close();
		for(int i = a; i <= b; ++i) {
			if(palindromic(i))++ans;
		}
		System.out.println(ans);
	}

}
