import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int start = scan.nextInt();
        int end = scan.nextInt();
        int ans = 0;
        
        for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        }
        
        System.out.println(ans);
    }
    
    private static int underHundred(int i){
        int temp = i%100;
        return temp%10*10 + temp/10;
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int start = scan.nextInt();
        int end = scan.nextInt();
        int ans = 0;
        
        for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        }
        
        System.out.println(ans);
    }
    
    private static int underHundred(int i){
        int temp = i%100;
        return temp%10*10 + temp/10;
    }
} Main public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int start = scan.nextInt();
        int end = scan.nextInt();
        int ans = 0;
        
        for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        }
        
        System.out.println(ans);
    } main {
        Scanner scan = new Scanner(System.in);
        
        int start = scan.nextInt();
        int end = scan.nextInt();
        int ans = 0;
        
        for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        }
        
        System.out.println(ans);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int start = scan.nextInt(); start scan.nextInt() scan.nextInt scan int end = scan.nextInt(); end scan.nextInt() scan.nextInt scan int ans = 0; ans 0 for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        } int i = start; int i = start; i start i <= end i end i++ i++ i {
            if(i/1000 == underHundred(i))
                ans++;
        } {
            if(i/1000 == underHundred(i))
                ans++;
        } if(i/1000 == underHundred(i))
                ans++; i/1000 == underHundred(i) i/1000 i 1000 underHundred(i) underHundred i ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String args[] args private static int underHundred(int i){
        int temp = i%100;
        return temp%10*10 + temp/10;
    } underHundred {
        int temp = i%100;
        return temp%10*10 + temp/10;
    } int temp = i%100; temp i%100 i 100 return temp%10*10 + temp/10; temp%10*10 + temp/10 temp%10*10 temp%10 temp 10 10 temp/10 temp 10 int i i public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int start = scan.nextInt();
        int end = scan.nextInt();
        int ans = 0;
        
        for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        }
        
        System.out.println(ans);
    }
    
    private static int underHundred(int i){
        int temp = i%100;
        return temp%10*10 + temp/10;
    }
} public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int start = scan.nextInt();
        int end = scan.nextInt();
        int ans = 0;
        
        for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        }
        
        System.out.println(ans);
    }
    
    private static int underHundred(int i){
        int temp = i%100;
        return temp%10*10 + temp/10;
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int start = scan.nextInt();
        int end = scan.nextInt();
        int ans = 0;
        
        for(int i = start; i <= end; i++){
            if(i/1000 == underHundred(i))
                ans++;
        }
        
        System.out.println(ans);
    }
    
    private static int underHundred(int i){
        int temp = i%100;
        return temp%10*10 + temp/10;
    }
}
