let a, b = Scanf.scanf " %d %d" @@ fun a b -> a, b
let f s = s.[0] = s.[4] && s.[1] = s.[3]
let ans = ref 0
let _ = for i = a to b do if f @@ string_of_int i then incr ans done; Printf.printf "%d\n" !ans