import java.util.Scanner;

public class Main {

    private Scanner in = new Scanner(System.in);

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

    private Scanner in = new Scanner(System.in);

    void solve() {
        int a = in.nextInt(), b = in.nextInt();
        int ans = 0;
        for(int i = a; i <=b; i++) {
            String s = String.valueOf(i);
            String t = new StringBuilder(s).reverse().toString();
            if(t.equals(s)) {
                ans ++;
            }
        }
        System.out.println(ans);
    }
    public static void main(String[] args) {
        new Main().solve();
    }
} Main private Scanner in = new Scanner(System.in); in new Scanner(System.in) void solve() {
        int a = in.nextInt(), b = in.nextInt();
        int ans = 0;
        for(int i = a; i <=b; i++) {
            String s = String.valueOf(i);
            String t = new StringBuilder(s).reverse().toString();
            if(t.equals(s)) {
                ans ++;
            }
        }
        System.out.println(ans);
    } solve {
        int a = in.nextInt(), b = in.nextInt();
        int ans = 0;
        for(int i = a; i <=b; i++) {
            String s = String.valueOf(i);
            String t = new StringBuilder(s).reverse().toString();
            if(t.equals(s)) {
                ans ++;
            }
        }
        System.out.println(ans);
    } int a = in.nextInt() a in.nextInt() in.nextInt in b = in.nextInt(); b in.nextInt() in.nextInt in int ans = 0; ans 0 for(int i = a; i <=b; i++) {
            String s = String.valueOf(i);
            String t = new StringBuilder(s).reverse().toString();
            if(t.equals(s)) {
                ans ++;
            }
        } int i = a; int i = a; i a i <=b i b i++ i++ i {
            String s = String.valueOf(i);
            String t = new StringBuilder(s).reverse().toString();
            if(t.equals(s)) {
                ans ++;
            }
        } {
            String s = String.valueOf(i);
            String t = new StringBuilder(s).reverse().toString();
            if(t.equals(s)) {
                ans ++;
            }
        } String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i String t = new StringBuilder(s).reverse().toString(); t new StringBuilder(s).reverse().toString() new StringBuilder(s).reverse().toString new StringBuilder(s).reverse() new StringBuilder(s).reverse new StringBuilder(s) if(t.equals(s)) {
                ans ++;
            } t.equals(s) t.equals t s {
                ans ++;
            } ans ++ ans System.out.println(ans) System.out.println System.out System System.out ans 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 {

    private Scanner in = new Scanner(System.in);

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

    private Scanner in = new Scanner(System.in);

    void solve() {
        int a = in.nextInt(), b = in.nextInt();
        int ans = 0;
        for(int i = a; i <=b; i++) {
            String s = String.valueOf(i);
            String t = new StringBuilder(s).reverse().toString();
            if(t.equals(s)) {
                ans ++;
            }
        }
        System.out.println(ans);
    }
    public static void main(String[] args) {
        new Main().solve();
    }
} Main
import java.util.Scanner;

public class Main {

    private Scanner in = new Scanner(System.in);

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