let () =
  (* 入力 *)
  let a,b = Scanf.scanf "%d %d " (fun a b -> a,b) in

  let res = ref 0 in
  for i = a to b do
    let c_arr = Array.of_list (Batteries.String.to_list (string_of_int i)) in
    if c_arr.(0) = c_arr.(4) && c_arr.(1) = c_arr.(3) then res := !res + 1
  done;

  Printf.printf "%d\n" !res
