
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int count = 0;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int count = 0;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int count = 0;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
	} main {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int count = 0;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int count = 0; count 0 for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		} {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		} String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i String reverse = new String(); reverse new String() for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			} int j = s.length(); int j = s.length(); j s.length() s.length s j > 0 j 0 j-- j-- j {
				reverse = reverse.concat(s.substring(j -1, j));
				
			} {
				reverse = reverse.concat(s.substring(j -1, j));
				
			} reverse = reverse.concat(s.substring(j -1, j)) reverse reverse.concat(s.substring(j -1, j)) reverse.concat reverse s.substring(j -1, j) s.substring s j -1 j 1 j if (reverse.equals(s)) {
				count++;
			} reverse.equals(s) reverse.equals reverse s {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int count = 0;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int count = 0;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int count = 0;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);

			String reverse = new String();
			for (int j = s.length(); j > 0; j--) {
				reverse = reverse.concat(s.substring(j -1, j));
				
			}
			if (reverse.equals(s)) {
				count++;
			}
		}
		System.out.println(count);
	}
}
