import scala.io.StdIn._

object Main extends App {
  val Seq(a, b) = readLine().split(" ").map(_.toInt).toSeq

  println(
    (a to b).count(i => i.toString.startsWith(i.toString.substring(i.toString.length / 2, i.toString.length).reverse))
  )
}
