import java.util.Scanner;




public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int A=sc.nextInt();
    	int B=sc.nextInt();


    	int counter=0;
    	for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	}

    	System.out.println(counter);


    }

    public static boolean Judge(int X) {

    	String str=String.valueOf(X);
    	String[] S=str.split("");

    	for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	}

    	return true;
    }



}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int A=sc.nextInt();
    	int B=sc.nextInt();


    	int counter=0;
    	for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	}

    	System.out.println(counter);


    }

    public static boolean Judge(int X) {

    	String str=String.valueOf(X);
    	String[] S=str.split("");

    	for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	}

    	return true;
    }



} Main public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    } main {

    	Main main=new Main();

    	main.run();

    } Main main=new Main(); main new Main() main.run() main.run main String[] args args void run() {
    	Scanner sc=new Scanner(System.in);

    	int A=sc.nextInt();
    	int B=sc.nextInt();


    	int counter=0;
    	for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	}

    	System.out.println(counter);


    } run {
    	Scanner sc=new Scanner(System.in);

    	int A=sc.nextInt();
    	int B=sc.nextInt();


    	int counter=0;
    	for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	}

    	System.out.println(counter);


    } 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 counter=0; counter 0 for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	} int i=A; int i=A; i A i<=B i B i++ i++ i {

    		if(Judge(i)) {
    			counter++;
    		}

    	} {

    		if(Judge(i)) {
    			counter++;
    		}

    	} if(Judge(i)) {
    			counter++;
    		} Judge(i) Judge i {
    			counter++;
    		} counter++ counter System.out.println(counter) System.out.println System.out System System.out counter public static boolean Judge(int X) {

    	String str=String.valueOf(X);
    	String[] S=str.split("");

    	for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	}

    	return true;
    } Judge {

    	String str=String.valueOf(X);
    	String[] S=str.split("");

    	for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	}

    	return true;
    } String str=String.valueOf(X); str String.valueOf(X) String.valueOf String X String[] S=str.split(""); S str.split("") str.split str "" for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	} int i=0; int i=0; i 0 i<S.length/2 i S.length/2 S.length S S.length 2 i++ i++ i {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	} {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	} if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		} !S[i].equals(S[S.length-1-i]) S[i].equals(S[S.length-1-i]) S[i].equals S[i] S i S[S.length-1-i] S S.length-1-i S.length-1-i S.length S S.length 1 i {
    			return false;
    		} return false; false return true; true int X X public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int A=sc.nextInt();
    	int B=sc.nextInt();


    	int counter=0;
    	for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	}

    	System.out.println(counter);


    }

    public static boolean Judge(int X) {

    	String str=String.valueOf(X);
    	String[] S=str.split("");

    	for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	}

    	return true;
    }



} public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int A=sc.nextInt();
    	int B=sc.nextInt();


    	int counter=0;
    	for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	}

    	System.out.println(counter);


    }

    public static boolean Judge(int X) {

    	String str=String.valueOf(X);
    	String[] S=str.split("");

    	for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	}

    	return true;
    }



} Main
import java.util.Scanner;




public class Main {

    public static void main(String[] args) {

    	Main main=new Main();

    	main.run();

    }

    void run() {
    	Scanner sc=new Scanner(System.in);

    	int A=sc.nextInt();
    	int B=sc.nextInt();


    	int counter=0;
    	for(int i=A;i<=B;i++) {

    		if(Judge(i)) {
    			counter++;
    		}

    	}

    	System.out.println(counter);


    }

    public static boolean Judge(int X) {

    	String str=String.valueOf(X);
    	String[] S=str.split("");

    	for(int i=0;i<S.length/2;i++) {

    		if(!S[i].equals(S[S.length-1-i])) {
    			return false;
    		}

    	}

    	return true;
    }



}

