import 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 cnt = 0;
		
		for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		}
		System.out.print(cnt);
	}

	public static boolean check(String sen) {
        int minIdx = 0;
        int maxIdx = sen.length() - 1;
 
        while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        }
        return true;
    }
} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int cnt = 0;
		
		for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		}
		System.out.print(cnt);
	}

	public static boolean check(String sen) {
        int minIdx = 0;
        int maxIdx = sen.length() - 1;
 
        while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        }
        return true;
    }
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int cnt = 0;
		
		for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		}
		System.out.print(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int cnt = 0;
		
		for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		}
		System.out.print(cnt);
	} 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 cnt = 0; cnt 0 for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		} int i=a ; int i=a ; i a i<=b i b i++ i++ i {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		} {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		} if( check(String.valueOf(i)) ) {
				cnt++;
			} check(String.valueOf(i)) check String.valueOf(i) String.valueOf String i {
				cnt++;
			} cnt++ cnt System.out.print(cnt) System.out.print System.out System System.out cnt String[] args args public static boolean check(String sen) {
        int minIdx = 0;
        int maxIdx = sen.length() - 1;
 
        while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        }
        return true;
    } check {
        int minIdx = 0;
        int maxIdx = sen.length() - 1;
 
        while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        }
        return true;
    } int minIdx = 0; minIdx 0 int maxIdx = sen.length() - 1; maxIdx sen.length() - 1 sen.length() sen.length sen 1 while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        } minIdx < maxIdx minIdx maxIdx {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        } if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            } sen.charAt(minIdx++) != sen.charAt(maxIdx--) sen.charAt(minIdx++) sen.charAt sen minIdx++ minIdx sen.charAt(maxIdx--) sen.charAt sen maxIdx-- maxIdx {
                return false;
            } return false; false return true; true String sen sen public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int cnt = 0;
		
		for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		}
		System.out.print(cnt);
	}

	public static boolean check(String sen) {
        int minIdx = 0;
        int maxIdx = sen.length() - 1;
 
        while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        }
        return true;
    }
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int cnt = 0;
		
		for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		}
		System.out.print(cnt);
	}

	public static boolean check(String sen) {
        int minIdx = 0;
        int maxIdx = sen.length() - 1;
 
        while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        }
        return true;
    }
} Main
import 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 cnt = 0;
		
		for(int i=a ; i<=b ; i++) {
			if( check(String.valueOf(i)) ) {
				cnt++;
			}
		}
		System.out.print(cnt);
	}

	public static boolean check(String sen) {
        int minIdx = 0;
        int maxIdx = sen.length() - 1;
 
        while(minIdx < maxIdx) {
            if(sen.charAt(minIdx++) != sen.charAt(maxIdx--)) {
                return false;
            }
        }
        return true;
    }
}
