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();
		
		int count = 0;
		
		for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		}
		System.out.println(count);
	}
} 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();
		
		int count = 0;
		
		for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		int count = 0;
		
		for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		int count = 0;
		
		for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		}
		System.out.println(count);
	} 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 int count = 0; count 0 for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		} int i = A; int i = A; i A i <= B i B i++ i++ i {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		} {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		} String As = new Integer(i).toString(); As new Integer(i).toString() new Integer(i).toString new Integer(i) StringBuffer Asb = new StringBuffer(As); Asb new StringBuffer(As) String AsbR = Asb.reverse().toString(); AsbR Asb.reverse().toString() Asb.reverse().toString Asb.reverse() Asb.reverse Asb if(As.equals(AsbR)) {
				count++;
			} As.equals(AsbR) As.equals As AsbR {
				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 sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		int count = 0;
		
		for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		
		int count = 0;
		
		for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		}
		System.out.println(count);
	}
} 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();
		
		int count = 0;
		
		for(int i = A; i <= B; i++) {
			String As = new Integer(i).toString();
			StringBuffer Asb = new StringBuffer(As);
			String AsbR = Asb.reverse().toString();
			if(As.equals(AsbR)) {
				count++;
			}
		}
		System.out.println(count);
	}
}
