import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		for (int i=a;i<=b;i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		}
		System.out.println(count);
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		for (int i=a;i<=b;i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		}
		System.out.println(count);
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		for (int i=a;i<=b;i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		}
		System.out.println(count);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		for (int i=a;i<=b;i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				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++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		} int i=a; int i=a; i a i<=b i b i++ i++ i {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		} {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		} StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append(String.valueOf(i)) sb.append sb String.valueOf(i) String.valueOf String i sb.reverse() sb.reverse sb if(sb.toString().equals(String.valueOf(i))) {
				count++;
			} sb.toString().equals(String.valueOf(i)) sb.toString().equals sb.toString() sb.toString sb String.valueOf(i) String.valueOf String i {
				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) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		for (int i=a;i<=b;i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		}
		System.out.println(count);
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		for (int i=a;i<=b;i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		}
		System.out.println(count);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int count = 0;
		for (int i=a;i<=b;i++) {
			StringBuilder sb = new StringBuilder();
			sb.append(String.valueOf(i));
			sb.reverse();
			if(sb.toString().equals(String.valueOf(i))) {
				count++;
			}

		}
		System.out.println(count);
	}

}
