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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int count = 0;
    for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    }
    System.out.println(count);
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int count = 0;
    for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    }
    System.out.println(count);
  }
} Main public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int count = 0;
    for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    }
    System.out.println(count);
  } main {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int count = 0;
    for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    }
    System.out.println(count);
  } BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); in new BufferedReader(new InputStreamReader(System.in)) String[] str = in.readLine().split(" "); str in.readLine().split(" ") in.readLine().split in.readLine() in.readLine in " " int a = Integer.parseInt(str[0]); a Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 int b = Integer.parseInt(str[1]); b Integer.parseInt(str[1]) Integer.parseInt Integer str[1] str 1 int count = 0; count 0 for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    } int i=a; int i=a; i a i<=b i b i++ i++ i {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    } {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    } StringBuffer sb = new StringBuffer(String.valueOf(i)); sb new StringBuffer(String.valueOf(i)) if(String.valueOf(i).equals(sb.reverse().toString()))
        count++; String.valueOf(i).equals(sb.reverse().toString()) String.valueOf(i).equals String.valueOf(i) String.valueOf String i sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb 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) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int count = 0;
    for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    }
    System.out.println(count);
  }
} public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int count = 0;
    for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    }
    System.out.println(count);
  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    int count = 0;
    for(int i=a; i<=b; i++) {
      StringBuffer sb = new StringBuffer(String.valueOf(i));
      if(String.valueOf(i).equals(sb.reverse().toString()))
        count++;
    }
    System.out.println(count);
  }
}