import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int min = sc.nextInt();
    int max = sc.nextInt();
        
    int count = 0;
        
    for(int i=min; i<=max; i++) {
        String val = String.valueOf(i);
        String reverseVal = (new StringBuilder(val)).reverse().toString();

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

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

        if(val.equals(reverseVal)) {
        	count++;
    	}
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int min = sc.nextInt();
    int max = sc.nextInt();
        
    int count = 0;
        
    for(int i=min; i<=max; i++) {
        String val = String.valueOf(i);
        String reverseVal = (new StringBuilder(val)).reverse().toString();

        if(val.equals(reverseVal)) {
        	count++;
    	}
    }
    System.out.println(count);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int min = sc.nextInt(); min sc.nextInt() sc.nextInt sc int max = sc.nextInt(); max sc.nextInt() sc.nextInt sc int count = 0; count 0 for(int i=min; i<=max; i++) {
        String val = String.valueOf(i);
        String reverseVal = (new StringBuilder(val)).reverse().toString();

        if(val.equals(reverseVal)) {
        	count++;
    	}
    } int i=min; int i=min; i min i<=max i max i++ i++ i {
        String val = String.valueOf(i);
        String reverseVal = (new StringBuilder(val)).reverse().toString();

        if(val.equals(reverseVal)) {
        	count++;
    	}
    } {
        String val = String.valueOf(i);
        String reverseVal = (new StringBuilder(val)).reverse().toString();

        if(val.equals(reverseVal)) {
        	count++;
    	}
    } String val = String.valueOf(i); val String.valueOf(i) String.valueOf String i String reverseVal = (new StringBuilder(val)).reverse().toString(); reverseVal (new StringBuilder(val)).reverse().toString() (new StringBuilder(val)).reverse().toString (new StringBuilder(val)).reverse() (new StringBuilder(val)).reverse (new StringBuilder(val)) if(val.equals(reverseVal)) {
        	count++;
    	} val.equals(reverseVal) val.equals val reverseVal {
        	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 min = sc.nextInt();
    int max = sc.nextInt();
        
    int count = 0;
        
    for(int i=min; i<=max; i++) {
        String val = String.valueOf(i);
        String reverseVal = (new StringBuilder(val)).reverse().toString();

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

        if(val.equals(reverseVal)) {
        	count++;
    	}
    }
    System.out.println(count);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int min = sc.nextInt();
    int max = sc.nextInt();
        
    int count = 0;
        
    for(int i=min; i<=max; i++) {
        String val = String.valueOf(i);
        String reverseVal = (new StringBuilder(val)).reverse().toString();

        if(val.equals(reverseVal)) {
        	count++;
    	}
    }
    System.out.println(count);
  }
}