import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().solve();
		return;
	}

	private void solve() {
		// 入力
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		// 計算
		int count = 0;
		String first;
		String last;
		for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		}

		// 出力
		System.out.println(count);

		return;
	}


} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		new Main().solve();
		return;
	}

	private void solve() {
		// 入力
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		// 計算
		int count = 0;
		String first;
		String last;
		for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		}

		// 出力
		System.out.println(count);

		return;
	}


} Main public static void main(String[] args) {
		new Main().solve();
		return;
	} main {
		new Main().solve();
		return;
	} new Main().solve() new Main().solve new Main() return; String[] args args private void solve() {
		// 入力
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		// 計算
		int count = 0;
		String first;
		String last;
		for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		}

		// 出力
		System.out.println(count);

		return;
	} solve {
		// 入力
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		// 計算
		int count = 0;
		String first;
		String last;
		for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		}

		// 出力
		System.out.println(count);

		return;
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc sc.close() sc.close sc int count = 0; count 0 String first; first String last; last for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		} int i = A; int i = A; i A i <= B i B i++ i++ i {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		} {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		} String value = String.valueOf(i); value String.valueOf(i) String.valueOf String i if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			} value.length() % 2 == 0 value.length() % 2 value.length() value.length value 2 0 {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} first = value.substring(0, value.length() / 2) first value.substring(0, value.length() / 2) value.substring value 0 value.length() / 2 value.length() value.length value 2 last = value.substring(value.length() / 2) last value.substring(value.length() / 2) value.substring value value.length() / 2 value.length() value.length value 2 {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			} first = value.substring(0, (value.length() + 1) / 2) first value.substring(0, (value.length() + 1) / 2) value.substring value 0 (value.length() + 1) / 2 (value.length() + 1) value.length() value.length value 1 2 last = value.substring(value.length() / 2) last value.substring(value.length() / 2) value.substring value value.length() / 2 value.length() value.length value 2 StringBuffer lastBuf = new StringBuffer(last); lastBuf new StringBuffer(last) if (first.equals(lastBuf.reverse().toString())) {
				count++;
			} first.equals(lastBuf.reverse().toString()) first.equals first lastBuf.reverse().toString() lastBuf.reverse().toString lastBuf.reverse() lastBuf.reverse lastBuf {
				count++;
			} count++ count System.out.println(count) System.out.println System.out System System.out count return; public class Main {
	public static void main(String[] args) {
		new Main().solve();
		return;
	}

	private void solve() {
		// 入力
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		// 計算
		int count = 0;
		String first;
		String last;
		for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		}

		// 出力
		System.out.println(count);

		return;
	}


} public class Main {
	public static void main(String[] args) {
		new Main().solve();
		return;
	}

	private void solve() {
		// 入力
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		// 計算
		int count = 0;
		String first;
		String last;
		for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		}

		// 出力
		System.out.println(count);

		return;
	}


} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().solve();
		return;
	}

	private void solve() {
		// 入力
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		// 計算
		int count = 0;
		String first;
		String last;
		for (int i = A; i <= B; i++) {
			String value = String.valueOf(i);
			if (value.length() % 2 == 0) {
				first = value.substring(0, value.length() / 2);
				last = value.substring(value.length() / 2);
			} else {
				first = value.substring(0, (value.length() + 1) / 2);
				last = value.substring(value.length() / 2);
			}
			StringBuffer lastBuf = new StringBuffer(last);
			if (first.equals(lastBuf.reverse().toString())) {
				count++;
			}
		}

		// 出力
		System.out.println(count);

		return;
	}


}
