import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int cnt = 0;
        for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        }
        System.out.println(cnt);
    }

    private static boolean isPalin(int num) {
        if(num % 10 == 0) return false;
        int originalNum = num;
        int n = 0;
        while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        }
        return n == originalNum;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int cnt = 0;
        for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        }
        System.out.println(cnt);
    }

    private static boolean isPalin(int num) {
        if(num % 10 == 0) return false;
        int originalNum = num;
        int n = 0;
        while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        }
        return n == originalNum;
    }
} Main public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int cnt = 0;
        for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        }
        System.out.println(cnt);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int cnt = 0;
        for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        }
        System.out.println(cnt);
    } 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 cnt = 0; cnt 0 for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            if(isPalin(i)) cnt++;
        } {
            if(isPalin(i)) cnt++;
        } if(isPalin(i)) cnt++; isPalin(i) isPalin i cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String args[] args private static boolean isPalin(int num) {
        if(num % 10 == 0) return false;
        int originalNum = num;
        int n = 0;
        while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        }
        return n == originalNum;
    } isPalin {
        if(num % 10 == 0) return false;
        int originalNum = num;
        int n = 0;
        while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        }
        return n == originalNum;
    } if(num % 10 == 0) return false; num % 10 == 0 num % 10 num 10 0 return false; false int originalNum = num; originalNum num int n = 0; n 0 while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        } num > 0 num 0 {
            n = n * 10 + num % 10;
            num /= 10;
        } n = n * 10 + num % 10 n n * 10 + num % 10 n * 10 n 10 num % 10 num 10 num /= 10 num 10 return n == originalNum; n == originalNum n originalNum int num num public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int cnt = 0;
        for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        }
        System.out.println(cnt);
    }

    private static boolean isPalin(int num) {
        if(num % 10 == 0) return false;
        int originalNum = num;
        int n = 0;
        while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        }
        return n == originalNum;
    }
} public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int cnt = 0;
        for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        }
        System.out.println(cnt);
    }

    private static boolean isPalin(int num) {
        if(num % 10 == 0) return false;
        int originalNum = num;
        int n = 0;
        while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        }
        return n == originalNum;
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int cnt = 0;
        for(int i = a; i <= b; i++) {
            if(isPalin(i)) cnt++;
        }
        System.out.println(cnt);
    }

    private static boolean isPalin(int num) {
        if(num % 10 == 0) return false;
        int originalNum = num;
        int n = 0;
        while(num > 0) {
            n = n * 10 + num % 10;
            num /= 10;
        }
        return n == originalNum;
    }
}
