

import scala.io.StdIn._

/**
 * ABC090B
 */
object Main extends App {

  val in = readLine().split(" ").toSeq

  val issame: (String => Boolean) = (str: String) => {
    (0 until str.length() / 2)
      .map(v => (str.charAt(v) == str.charAt(str.length() - 1 - v)))
      .forall(_ == true)
  }: Boolean

  val ans = (in(0).toInt to in(1).toInt)
    .map(_.toString)
    .count(issame)

  println(ans)
}


    