import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i = A; i <= B; i++) {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        }
        System.out.println(count);
    }
} import java.util.*; util.* java class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i = A; i <= B; i++) {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        }
        System.out.println(count);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i = A; i <= B; i++) {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i = A; i <= B; i++) {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        }
        System.out.println(count);
    } 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 count = 0; count 0 for(int i = A; i <= B; i++) {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        } int i = A; int i = A; i A i <= B i B i++ i++ i {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        } {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        } String tmp = String.valueOf(i); tmp String.valueOf(i) String.valueOf String i boolean ok = true; ok true for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            } int j = 0; int j = 0; j 0 j < tmp.length() / 2 j tmp.length() / 2 tmp.length() tmp.length tmp 2 j++ j++ j {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            } {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            } if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                } tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1) tmp.charAt(j) tmp.charAt tmp j tmp.charAt(tmp.length() - j - 1) tmp.charAt tmp tmp.length() - j - 1 tmp.length() - j - 1 tmp.length() tmp.length tmp j 1 {
                    ok = false;
                    break;
                } ok = false ok false break; if(ok) count++; ok count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();
        int count = 0;
        for(int i = A; i <= B; i++) {
            String tmp = String.valueOf(i);
            boolean ok = true;
            for(int j = 0; j < tmp.length() / 2; j++) {
                if(tmp.charAt(j) != tmp.charAt(tmp.length() - j - 1)) {
                    ok = false;
                    break;
                }
            }
            if(ok) count++;
        }
        System.out.println(count);
    }
}