fun main(args: Array<String>) {
    val line = readLine()!!.split(" ").map { it.toInt() }
    val a = line[0]
    val b = line[1]

    var result = 0
    for (i in (a..b)) {
        val reversed = i.toString().toCharArray().reversed().joinToString("")

        if (i.toString() == reversed) {
            result += 1
        }
    }

    print(result)

}