import java.util.*;

public class Main{

    void solve(){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        }
        System.out.println(out);
    }


    public static void main(String[] args){
        new Main().solve();
    }
} import java.util.*; util.* java public class Main{

    void solve(){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        }
        System.out.println(out);
    }


    public static void main(String[] args){
        new Main().solve();
    }
} Main void solve(){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        }
        System.out.println(out);
    } solve {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        }
        System.out.println(out);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int a = scan.nextInt(); a scan.nextInt() scan.nextInt scan int b = scan.nextInt(); b scan.nextInt() scan.nextInt scan int out = 0; out 0 for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        } {
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        } StringBuilder s = new StringBuilder(Integer.toString(i)); s new StringBuilder(Integer.toString(i)) if(s.toString().equals(s.reverse().toString())) out++; s.toString().equals(s.reverse().toString()) s.toString().equals s.toString() s.toString s s.reverse().toString() s.reverse().toString s.reverse() s.reverse s out++ out System.out.println(out) System.out.println System.out System System.out out public static void main(String[] args){
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args public class Main{

    void solve(){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        }
        System.out.println(out);
    }


    public static void main(String[] args){
        new Main().solve();
    }
} public class Main{

    void solve(){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        }
        System.out.println(out);
    }


    public static void main(String[] args){
        new Main().solve();
    }
} Main
import java.util.*;

public class Main{

    void solve(){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        int out = 0;
        for(int i = a; i <= b; i++){
            StringBuilder s = new StringBuilder(Integer.toString(i));
            if(s.toString().equals(s.reverse().toString())) out++;
        }
        System.out.println(out);
    }


    public static void main(String[] args){
        new Main().solve();
    }
}
