import java.util.*

val sc = Scanner(System.`in`)
val A = sc.nextInt()
val B = sc.nextInt()

fun main(args: Array<String>) {
    (A..B).map { if (judge(it)) 1 else 0 }.sum().run(::println)
}

fun judge(n: Int): Boolean {
    val s = n.toString()
    for (i in 0 until s.length / 2) {
        if (s[i] != s[s.length - 1 - i]) {
            return false
        }
    }
    return true
}
