import java.util.Scanner;

public class Main {

    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int lower = sc.nextInt();
        int upper = sc.nextInt();
        for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        }
        System.out.println(count);
    }
    
} import java.util.Scanner; Scanner java.util public class Main {

    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int lower = sc.nextInt();
        int upper = sc.nextInt();
        for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        }
        System.out.println(count);
    }
    
} Main public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int lower = sc.nextInt();
        int upper = sc.nextInt();
        for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int lower = sc.nextInt();
        int upper = sc.nextInt();
        for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        }
        System.out.println(count);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int count = 0; count 0 int lower = sc.nextInt(); lower sc.nextInt() sc.nextInt sc int upper = sc.nextInt(); upper sc.nextInt() sc.nextInt sc for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        } int num = lower; int num = lower; num lower num <= upper num upper num++ num++ num {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        } {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        } if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            } String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString()) String.valueOf(num).equals String.valueOf(num) String.valueOf String num new StringBuilder(String.valueOf(num)).reverse().toString() new StringBuilder(String.valueOf(num)).reverse().toString new StringBuilder(String.valueOf(num)).reverse() new StringBuilder(String.valueOf(num)).reverse new StringBuilder(String.valueOf(num)) {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int lower = sc.nextInt();
        int upper = sc.nextInt();
        for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        }
        System.out.println(count);
    }
    
} public class Main {

    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int lower = sc.nextInt();
        int upper = sc.nextInt();
        for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        }
        System.out.println(count);
    }
    
} Main
import java.util.Scanner;

public class Main {

    public static void main (String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        int lower = sc.nextInt();
        int upper = sc.nextInt();
        for (int num = lower; num <= upper; num++) {
            if (String.valueOf(num).equals(new StringBuilder(String.valueOf(num)).reverse().toString())) {
                count++;
            }
        }
        System.out.println(count);
    }
    
}
