import scala.io.StdIn.readLine

object Main extends App {
  val Array(a, b) = readLine().split(' ').map(_.toInt)
  
  val result = (a to b).filter { n =>
    n.toString == n.toString.reverse
  }.length
  
  println(result)
}