import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        }
        System.out.println(answer);
    }
    public boolean kaibun(char[] d) {
        int length = d.length;
        for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        }
        return true;
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        }
        System.out.println(answer);
    }
    public boolean kaibun(char[] d) {
        int length = d.length;
        for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        }
        return true;
    }
} Main public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    } main {
        Main main = new Main();
        main.solve();
    } Main main = new Main(); main new Main() main.solve() main.solve main String[] args args public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        }
        System.out.println(answer);
    } solve {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        }
        System.out.println(answer);
    } Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in))); scan new Scanner(new BufferedReader(new InputStreamReader(System.in))) int A = scan.nextInt(); A scan.nextInt() scan.nextInt scan int B = scan.nextInt(); B scan.nextInt() scan.nextInt scan long answer = 0; answer 0 for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        } int i = A; int i = A; i A i <= B i B i++ i++ i {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        } {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        } String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i char[] d = s.toCharArray(); d s.toCharArray() s.toCharArray s if (kaibun(d)) {
                answer += 1;
            } kaibun(d) kaibun d {
                answer += 1;
            } answer += 1 answer 1 System.out.println(answer) System.out.println System.out System System.out answer public boolean kaibun(char[] d) {
        int length = d.length;
        for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        }
        return true;
    } kaibun {
        int length = d.length;
        for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        }
        return true;
    } int length = d.length; length d.length d d.length for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        } int i = 0; int i = 0; i 0 i < length / 2 i length / 2 length 2 i++ i++ i {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        } {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        } if (d[i] != d[length-i-1]) {
                return false;
            } d[i] != d[length-i-1] d[i] d i d[length-i-1] d length-i-1 length-i-1 length i 1 {
                return false;
            } return false; false return true; true char[] d d public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        }
        System.out.println(answer);
    }
    public boolean kaibun(char[] d) {
        int length = d.length;
        for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        }
        return true;
    }
} public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        }
        System.out.println(answer);
    }
    public boolean kaibun(char[] d) {
        int length = d.length;
        for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        }
        return true;
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        long answer = 0;
        for (int i = A; i <= B; i++) {
            String s = Integer.toString(i);
            char[] d = s.toCharArray();
            if (kaibun(d)) {
                answer += 1;
            }
        }
        System.out.println(answer);
    }
    public boolean kaibun(char[] d) {
        int length = d.length;
        for (int i = 0; i < length / 2; i++) {
            if (d[i] != d[length-i-1]) {
                return false;
            }
        }
        return true;
    }
}
