import java.util.*;

public class Main {
	public static void main(String[] args){
		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 (isPalindrome(i)) {
          cnt++;
        }
    }

    System.out.println(cnt);
	}

  private static boolean isPalindrome(int x) {
    List<Integer> list = new ArrayList<Integer>();
    while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    }

    int size = list.size();
    for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    }
    return true;
  }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		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 (isPalindrome(i)) {
          cnt++;
        }
    }

    System.out.println(cnt);
	}

  private static boolean isPalindrome(int x) {
    List<Integer> list = new ArrayList<Integer>();
    while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    }

    int size = list.size();
    for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    }
    return true;
  }
} Main public static void main(String[] args){
		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 (isPalindrome(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 (isPalindrome(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 (isPalindrome(i)) {
          cnt++;
        }
    } int i = a; int i = a; i a i <= b i b i++ i++ i {
        if (isPalindrome(i)) {
          cnt++;
        }
    } {
        if (isPalindrome(i)) {
          cnt++;
        }
    } if (isPalindrome(i)) {
          cnt++;
        } isPalindrome(i) isPalindrome i {
          cnt++;
        } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args private static boolean isPalindrome(int x) {
    List<Integer> list = new ArrayList<Integer>();
    while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    }

    int size = list.size();
    for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    }
    return true;
  } isPalindrome {
    List<Integer> list = new ArrayList<Integer>();
    while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    }

    int size = list.size();
    for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    }
    return true;
  } List<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    } x > 0 x 0 {
      list.add(x - (x / 10 * 10));
      x /= 10;
    } list.add(x - (x / 10 * 10)) list.add list x - (x / 10 * 10) x (x / 10 * 10) x / 10 x 10 10 x /= 10 x 10 int size = list.size(); size list.size() list.size list for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    } int i = 0; int i = 0; i 0 i < size / 2 i size / 2 size 2 i++ i++ i {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    } {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    } if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			} list.get(i) != list.get(size - 1 - i) list.get(i) list.get list i list.get(size - 1 - i) list.get list size - 1 - i size - 1 - i size 1 i {
				return false;
			} return false; false return true; true int x x public class Main {
	public static void main(String[] args){
		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 (isPalindrome(i)) {
          cnt++;
        }
    }

    System.out.println(cnt);
	}

  private static boolean isPalindrome(int x) {
    List<Integer> list = new ArrayList<Integer>();
    while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    }

    int size = list.size();
    for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    }
    return true;
  }
} public class Main {
	public static void main(String[] args){
		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 (isPalindrome(i)) {
          cnt++;
        }
    }

    System.out.println(cnt);
	}

  private static boolean isPalindrome(int x) {
    List<Integer> list = new ArrayList<Integer>();
    while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    }

    int size = list.size();
    for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    }
    return true;
  }
} Main
import java.util.*;

public class Main {
	public static void main(String[] args){
		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 (isPalindrome(i)) {
          cnt++;
        }
    }

    System.out.println(cnt);
	}

  private static boolean isPalindrome(int x) {
    List<Integer> list = new ArrayList<Integer>();
    while (x > 0) {
      list.add(x - (x / 10 * 10));
      x /= 10;
    }

    int size = list.size();
    for (int i = 0; i < size / 2; i++) {
      if (list.get(i) != list.get(size - 1 - i)) {
				return false;
			}
    }
    return true;
  }
}
