import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int cnt = 0;
		for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
		
	}

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int cnt = 0;
		for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
		
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int cnt = 0;
		for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int cnt = 0;
		for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int a = stdIn.nextInt(); a stdIn.nextInt() stdIn.nextInt stdIn int b = stdIn.nextInt(); b stdIn.nextInt() stdIn.nextInt stdIn int cnt = 0; cnt 0 for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		} {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		} String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			} s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2) s.charAt(0)==s.charAt(s.length()-1) s.charAt(0) s.charAt s 0 s.charAt(s.length()-1) s.charAt s s.length()-1 s.length() s.length s 1 s.charAt(1) == s.charAt(s.length()-2) s.charAt(1) s.charAt s 1 s.charAt(s.length()-2) s.charAt s s.length()-2 s.length() s.length s 2 {
				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 stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int cnt = 0;
		for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int cnt = 0;
		for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
		
	}

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int cnt = 0;
		for(int i = a; i <= b; i++ ) {
			String s = String.valueOf(i);
			if(s.charAt(0)==s.charAt(s.length()-1) && s.charAt(1) == s.charAt(s.length()-2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
		
		
	}

}
