fun main(args: Array<String>) {
    val (A,B) = readLine()!!.split(" ").map(String::toInt)
    for (x in A..B) {
        val s = x.toString()

    }
    val ans = (A..B).map { it.toString() }.count {
        if (it.length%2==0) {
            it.substring(0, it.length/2) == it.substring(it.length/2).reversed()
        } else {
            it.substring(0, it.length/2) == it.substring(it.length/2+1).reversed()
        }
    }
    println(ans)
}