import Foundation
func toTuple<T>(_ args: [T]) -> (T, T) { (args[0], args[1]) }
func readInts() -> [Int] { readLine()!.split(separator: " ").map { Int($0)! } }

let (a, b) = toTuple(readInts())
var ans = 0
for i in a...b {
  let fHalf = String(i).prefix(2)
  let lHalf = String(i).suffix(2).reversed()
  if String(fHalf) == String(lHalf) {
    ans += 1
  }
}
print(ans)