object Main {

	def main(arg:Array[String]) = {
		val list = scala.io.StdIn.readLine().split(" ").map(_.toInt);
		println(
			(list(0) to list(1)).filter(x => x.toString == x.toString.reverse).size
		);
	}

}