fun Int.isPalindromic(): Boolean {
    val s = toString()
    var p = 0
    var q = s.length - 1
    while (p < q) {
        if (s[p++] != s[q--]) return false
    }
    return true
}

fun main(args: Array<String>) {
    val (a, b) = readLine()!!.split(' ').map(String::toInt)
    println((a..b).count(Int::isPalindromic))
}
