import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
 
public class Main {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int cnt= 0;
		int b = sc.nextInt();
		for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		}
		System.out.println(cnt);
	}
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
 
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
 
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
 
		public int nextInt() {
			return Integer.parseInt(next());
		}
 
		public long nextLong() {
			return Long.parseLong(next());
		}
 
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
 
	}
} import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java import java.math.*; math.* java public class Main {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int cnt= 0;
		int b = sc.nextInt();
		for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		}
		System.out.println(cnt);
	}
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
 
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
 
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
 
		public int nextInt() {
			return Integer.parseInt(next());
		}
 
		public long nextLong() {
			return Long.parseLong(next());
		}
 
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
 
	}
} Main public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int cnt= 0;
		int b = sc.nextInt();
		for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		}
		System.out.println(cnt);
	} main {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int cnt= 0;
		int b = sc.nextInt();
		for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		}
		System.out.println(cnt);
	} FastScanner sc = new FastScanner(); sc new FastScanner() int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int cnt= 0; cnt 0 int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		} int i=a; int i=a; i a i <= b i b i++ i++ i {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		} {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		} String s = ""+i; s ""+i "" i String rev = new StringBuffer(s).reverse().toString(); rev new StringBuffer(s).reverse().toString() new StringBuffer(s).reverse().toString new StringBuffer(s).reverse() new StringBuffer(s).reverse new StringBuffer(s) if(rev.equals(s)) ++cnt; rev.equals(s) rev.equals rev s ++cnt cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
 
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
 
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
 
		public int nextInt() {
			return Integer.parseInt(next());
		}
 
		public long nextLong() {
			return Long.parseLong(next());
		}
 
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
 
	} FastScanner public BufferedReader reader; reader public StringTokenizer tokenizer; tokenizer public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		} FastScanner {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		} reader = new BufferedReader(new InputStreamReader(System.in), 32768) reader new BufferedReader(new InputStreamReader(System.in), 32768) tokenizer = null tokenizer null public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		} next {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		} while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			} tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			} try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				} catch (IOException e) {
					throw new RuntimeException(e);
				} IOException e {
					throw new RuntimeException(e);
				} throw new RuntimeException(e); new RuntimeException(e) {
					tokenizer = new StringTokenizer(reader.readLine());
				} tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public int nextInt() {
			return Integer.parseInt(next());
		} nextInt {
			return Integer.parseInt(next());
		} return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public long nextLong() {
			return Long.parseLong(next());
		} nextLong {
			return Long.parseLong(next());
		} return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() {
			return Double.parseDouble(next());
		} nextDouble {
			return Double.parseDouble(next());
		} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		} nextLine {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		} try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			} catch (IOException e) {
				throw new RuntimeException(e);
			} IOException e {
				throw new RuntimeException(e);
			} throw new RuntimeException(e); new RuntimeException(e) {
				return reader.readLine();
			} return reader.readLine(); reader.readLine() reader.readLine reader public class Main {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int cnt= 0;
		int b = sc.nextInt();
		for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		}
		System.out.println(cnt);
	}
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
 
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
 
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
 
		public int nextInt() {
			return Integer.parseInt(next());
		}
 
		public long nextLong() {
			return Long.parseLong(next());
		}
 
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
 
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int cnt= 0;
		int b = sc.nextInt();
		for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		}
		System.out.println(cnt);
	}
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
 
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
 
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
 
		public int nextInt() {
			return Integer.parseInt(next());
		}
 
		public long nextLong() {
			return Long.parseLong(next());
		}
 
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
 
	}
} Main
import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
 
public class Main {
	public static void main(String[] args) throws Exception {
		FastScanner sc = new FastScanner();
		int a = sc.nextInt();
		int cnt= 0;
		int b = sc.nextInt();
		for(int i=a; i <= b; i++) {
			String s = ""+i;
			String rev = new StringBuffer(s).reverse().toString();
			if(rev.equals(s)) ++cnt;
		}
		System.out.println(cnt);
	}
	static class FastScanner {
		public BufferedReader reader;
		public StringTokenizer tokenizer;
 
		public FastScanner() {
			reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			tokenizer = null;
		}
 
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
 
		public int nextInt() {
			return Integer.parseInt(next());
		}
 
		public long nextLong() {
			return Long.parseLong(next());
		}
 
		public double nextDouble() {
			return Double.parseDouble(next());
		}
 
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
 
	}
}