/*
[ ( ^ _ ^ ) ]
*/

import java.io.*;
import java.util.*;


class Main {
    int INF = (int)1e9;
    long MOD = 1000000007;
    
    boolean go(int n) {
        String s = ""+n;
        String r = new StringBuilder(s).reverse().toString();
        return s.equals(r);
    }

    void solve(InputReader in, PrintWriter out) throws IOException {
        int a = in.nextInt();
        int b = in.nextInt();
        int rs = 0;
        for(int i=a; i<=b; i++) {
            if(go(i)) rs++;
        }
        out.println(rs);
    }
    
    
    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java class Main {
    int INF = (int)1e9;
    long MOD = 1000000007;
    
    boolean go(int n) {
        String s = ""+n;
        String r = new StringBuilder(s).reverse().toString();
        return s.equals(r);
    }

    void solve(InputReader in, PrintWriter out) throws IOException {
        int a = in.nextInt();
        int b = in.nextInt();
        int rs = 0;
        for(int i=a; i<=b; i++) {
            if(go(i)) rs++;
        }
        out.println(rs);
    }
    
    
    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
} Main int INF = (int)1e9; INF (int)1e9 long MOD = 1000000007; MOD 1000000007 static boolean DEBUG_FLAG = false; DEBUG_FLAG false boolean go(int n) {
        String s = ""+n;
        String r = new StringBuilder(s).reverse().toString();
        return s.equals(r);
    } go {
        String s = ""+n;
        String r = new StringBuilder(s).reverse().toString();
        return s.equals(r);
    } String s = ""+n; s ""+n "" n String r = new StringBuilder(s).reverse().toString(); r new StringBuilder(s).reverse().toString() new StringBuilder(s).reverse().toString new StringBuilder(s).reverse() new StringBuilder(s).reverse new StringBuilder(s) return s.equals(r); s.equals(r) s.equals s r int n n void solve(InputReader in, PrintWriter out) throws IOException {
        int a = in.nextInt();
        int b = in.nextInt();
        int rs = 0;
        for(int i=a; i<=b; i++) {
            if(go(i)) rs++;
        }
        out.println(rs);
    } solve {
        int a = in.nextInt();
        int b = in.nextInt();
        int rs = 0;
        for(int i=a; i<=b; i++) {
            if(go(i)) rs++;
        }
        out.println(rs);
    } int a = in.nextInt(); a in.nextInt() in.nextInt in int b = in.nextInt(); b in.nextInt() in.nextInt in int rs = 0; rs 0 for(int i=a; i<=b; i++) {
            if(go(i)) rs++;
        } int i=a; int i=a; i a i<=b i b i++ i++ i {
            if(go(i)) rs++;
        } {
            if(go(i)) rs++;
        } if(go(i)) rs++; go(i) go i rs++ rs out.println(rs) out.println out rs InputReader in in PrintWriter out out public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    } main {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    } if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        } args.length>0 && args[0].equalsIgnoreCase("d") args.length>0 args.length args args.length 0 args[0].equalsIgnoreCase("d") args[0].equalsIgnoreCase args[0] args 0 "d" {
            DEBUG_FLAG = true;
        } DEBUG_FLAG = true DEBUG_FLAG true InputReader in = new InputReader(); in new InputReader() PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int t = 1; t 1 long start = System.nanoTime(); start System.nanoTime() System.nanoTime System while(t-- >0) {
            new Main().solve(in, out);
        } t-- >0 t-- t 0 {
            new Main().solve(in, out);
        } new Main().solve(in, out) new Main().solve new Main() in out long end = System.nanoTime(); end System.nanoTime() System.nanoTime System debug("\nTime: " + (end-start)/1e6 + " \n\n") debug "\nTime: " + (end-start)/1e6 + " \n\n" "\nTime: " + (end-start)/1e6 + " \n\n" "\nTime: " (end-start)/1e6 (end-start) end start 1e6 " \n\n" out.close() out.close out String[] args args static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    } debug {
        if(DEBUG_FLAG) System.out.print(s);
    } if(DEBUG_FLAG) System.out.print(s); DEBUG_FLAG System.out.print(s) System.out.print System.out System System.out s String s s public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    } show {
        System.out.println(Arrays.deepToString(o));
    } System.out.println(Arrays.deepToString(o)) System.out.println System.out System System.out Arrays.deepToString(o) Arrays.deepToString Arrays o Object... o o static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    } InputReader static BufferedReader br; br static StringTokenizer st; st public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        } InputReader {
            br = new BufferedReader(new InputStreamReader(System.in));
        } br = new BufferedReader(new InputStreamReader(System.in)) br new BufferedReader(new InputStreamReader(System.in)) String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } next {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        } while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } st == null || !st.hasMoreTokens() st == null st null !st.hasMoreTokens() st.hasMoreTokens() st.hasMoreTokens st {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            } try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                } catch (IOException e) {
                    e.printStackTrace();
                } IOException e {
                    e.printStackTrace();
                } e.printStackTrace() e.printStackTrace e {
                    st = new StringTokenizer(br.readLine());
                } st = new StringTokenizer(br.readLine()) st new StringTokenizer(br.readLine()) return st.nextToken(); st.nextToken() st.nextToken st int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next
/*
[ ( ^ _ ^ ) ]
*/

import java.io.*;
import java.util.*;


class Main {
    int INF = (int)1e9;
    long MOD = 1000000007;
    
    boolean go(int n) {
        String s = ""+n;
        String r = new StringBuilder(s).reverse().toString();
        return s.equals(r);
    }

    void solve(InputReader in, PrintWriter out) throws IOException {
        int a = in.nextInt();
        int b = in.nextInt();
        int rs = 0;
        for(int i=a; i<=b; i++) {
            if(go(i)) rs++;
        }
        out.println(rs);
    }
    
    
    public static void main(String[] args) throws IOException {
        if(args.length>0 && args[0].equalsIgnoreCase("d")) {
            DEBUG_FLAG = true;
        }
        InputReader in = new InputReader();
        PrintWriter out = new PrintWriter(System.out);
        int t = 1;//in.nextInt();
        long start = System.nanoTime();
        while(t-- >0) {
            new Main().solve(in, out);
        }
        long end = System.nanoTime();
        debug("\nTime: " + (end-start)/1e6 + " \n\n");
        out.close();
    }
    
    static boolean DEBUG_FLAG = false;
    static void debug(String s) {
        if(DEBUG_FLAG) System.out.print(s);
    }
    
    public static void show(Object... o) {
        System.out.println(Arrays.deepToString(o));
    }
    
    static class InputReader {
        static BufferedReader br;
        static StringTokenizer st;
    
        public InputReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        
        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        
        int nextInt() {
            return Integer.parseInt(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}