import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        int ans = 0, digit1, digit2, digit4, digit5, temp;
        
        
        for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        }
        
        System.out.println(ans);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        int ans = 0, digit1, digit2, digit4, digit5, temp;
        
        
        for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        }
        
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        int ans = 0, digit1, digit2, digit4, digit5, temp;
        
        
        for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        }
        
        System.out.println(ans);
    } main {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        int ans = 0, digit1, digit2, digit4, digit5, temp;
        
        
        for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        }
        
        System.out.println(ans);
    } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] ab = br.readLine().split(" "); ab br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int a = Integer.parseInt(ab[0]); a Integer.parseInt(ab[0]) Integer.parseInt Integer ab[0] ab 0 int b = Integer.parseInt(ab[1]); b Integer.parseInt(ab[1]) Integer.parseInt Integer ab[1] ab 1 int ans = 0 ans 0 digit1 digit1 digit2 digit2 digit4 digit4 digit5 digit5 temp; temp for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        } {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        } temp = i temp i digit5 = temp % 10 digit5 temp % 10 temp 10 temp /= 10 temp 10 digit4 = temp % 10 digit4 temp % 10 temp 10 temp /= 10 temp 10 temp /= 10 temp 10 digit2 = temp % 10 digit2 temp % 10 temp 10 temp /= 10 temp 10 digit1 = temp % 10 digit1 temp % 10 temp 10 if (digit1 == digit5 && digit2 == digit4) ans++; digit1 == digit5 && digit2 == digit4 digit1 == digit5 digit1 digit5 digit2 == digit4 digit2 digit4 ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        int ans = 0, digit1, digit2, digit4, digit5, temp;
        
        
        for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        }
        
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        int ans = 0, digit1, digit2, digit4, digit5, temp;
        
        
        for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        }
        
        System.out.println(ans);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] ab = br.readLine().split(" ");
        int a = Integer.parseInt(ab[0]);
        int b = Integer.parseInt(ab[1]);
        int ans = 0, digit1, digit2, digit4, digit5, temp;
        
        
        for (int i = a; i <= b; i++) {
            temp = i;
            digit5 = temp % 10;
            temp /= 10;
            digit4 = temp % 10;
            temp /= 10;
            temp /= 10;
            digit2 = temp % 10;
            temp /= 10;
            digit1 = temp % 10;
            
            if (digit1 == digit5 && digit2 == digit4) ans++;
        }
        
        System.out.println(ans);
    }
}
