import scala.io.StdIn.{readLine}

object Main extends App {
  def isPalindromic(s: String): Boolean = {
    val (src, dst) = s.splitAt(s.length / 2 + 1)
    val taked = src.take(dst.length)
    taked == dst.reverse
  }

  def nPalindromic(input: String): Int = {
    val ints = input.split(" ").map(_.toInt)
    nPalindromic(ints(0), ints(1))

  }

  def nPalindromic(start: Int, end: Int):Int = {
    Range(start, end).count(i => isPalindromic(i.toString))
  }

  println(nPalindromic(readLine()))
}