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