import scala.io.StdIn

object Main extends App {
  val a = StdIn.readLine().split(' ')
  println((Integer.parseInt(a(0)) to Integer.parseInt(a(1))).foldLeft(0){ (acc, i) =>
    val tmp = i.toString
    if(tmp.take(2).reverse == tmp.takeRight(2)) acc + 1 else acc
  })
}
