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