import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100);
		boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100);
		System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0));
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100);
		boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100);
		System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0));
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100);
		boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100);
		System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0));
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100);
		boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100);
		System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0));
	} 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 boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100); plusA (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100) (A % 10000 / 1000) * 10 + (A / 10000) (A % 10000 / 1000) * 10 (A % 10000 / 1000) A % 10000 A 10000 1000 10 (A / 10000) A 10000 (A % 100) A 100 boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100); plusB (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100) (B % 10000 / 1000) * 10 + (B / 10000) (B % 10000 / 1000) * 10 (B % 10000 / 1000) B % 10000 B 10000 1000 10 (B / 10000) B 10000 (B % 100) B 100 System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0)) System.out.println System.out System System.out (B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0) (B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0) (B / 100) - (A / 100) - 1 (B / 100) - (A / 100) - 1 (B / 100) B 100 (A / 100) A 100 1 (plusA ? 1 : 0) plusA 1 0 (plusB ? 1 : 0) plusB 1 0 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100);
		boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100);
		System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0));
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100);
		boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100);
		System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0));
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		boolean plusA = (A % 10000 / 1000) * 10 + (A / 10000) >= (A % 100);
		boolean plusB = (B % 10000 / 1000) * 10 + (B / 10000) <= (B % 100);
		System.out.println((B / 100) - (A / 100) - 1 + (plusA ? 1 : 0) + (plusB ? 1 : 0));
	}
}
