(*
ocamlfind ocamlopt -package batteries -linkpkg main.ml -o a.out
*)
open Batteries

let a, b = Scanf.sscanf (read_line ()) "%d %d" ( fun a b -> a, b)
let lst = List.range a `To b
          |> List.map string_of_int


let rec f lst =
        match lst with
                  [] -> 0
                | first :: rest -> 
                        let len2 = String.length first / 2 in
                        let h = String.sub first 0 len2 in
                        let t = String.sub (String.rev first) 0 len2 in
                        let n = f rest in
                                if h = t then
                                        1 + n
                                else
                                        n

let () =
        f lst 
        |> Printf.printf "%d\n"
