fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    println((sc.next().toInt()..sc.next().toInt())
            .map({i:Int -> i.toString()})
            .filter({s:String -> s[0] == s[4] && s[1] == s[3] } )
            .size
    )
}