

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		
		String s = null;
		String sb  = null;
		String s1 = null;
		String s3 = null;

		int cnt = 0;
		
	
		for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		}
		
		System.out.println(cnt);
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		
		String s = null;
		String sb  = null;
		String s1 = null;
		String s3 = null;

		int cnt = 0;
		
	
		for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		}
		
		System.out.println(cnt);
		
	}

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		
		String s = null;
		String sb  = null;
		String s1 = null;
		String s3 = null;

		int cnt = 0;
		
	
		for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		}
		
		System.out.println(cnt);
		
	} main {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		
		String s = null;
		String sb  = null;
		String s1 = null;
		String s3 = null;

		int cnt = 0;
		
	
		for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		}
		
		System.out.println(cnt);
		
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner scanner.close() scanner.close scanner String s = null; s null String sb  = null; sb null String s1 = null; s1 null String s3 = null; s3 null int cnt = 0; cnt 0 for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		} {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		} s = String.valueOf(i) s String.valueOf(i) String.valueOf String i s1 = s.substring(0, 2) s1 s.substring(0, 2) s.substring s 0 2 s3 = s.substring(3, 5) s3 s.substring(3, 5) s.substring s 3 5 StringBuffer reBuff = new StringBuffer(s3).reverse(); reBuff new StringBuffer(s3).reverse() new StringBuffer(s3).reverse new StringBuffer(s3) if (s1.equals(reBuff.toString())) {
				cnt++;
			} s1.equals(reBuff.toString()) s1.equals s1 reBuff.toString() reBuff.toString reBuff {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		
		String s = null;
		String sb  = null;
		String s1 = null;
		String s3 = null;

		int cnt = 0;
		
	
		for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		}
		
		System.out.println(cnt);
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		
		String s = null;
		String sb  = null;
		String s1 = null;
		String s3 = null;

		int cnt = 0;
		
	
		for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		}
		
		System.out.println(cnt);
		
	}

} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();
		scanner.close();
		
		String s = null;
		String sb  = null;
		String s1 = null;
		String s3 = null;

		int cnt = 0;
		
	
		for (int i = a; i <= b; i++) {
			s = String.valueOf(i);
			s1 = s.substring(0, 2);
			s3 = s.substring(3, 5);
			StringBuffer reBuff = new StringBuffer(s3).reverse();
			if (s1.equals(reBuff.toString())) {
				cnt++;
			}
			
		}
		
		System.out.println(cnt);
		
	}

}
