open System

let isPalindromic (str:string) =
    let rStr = 
        str.ToCharArray()
        |> Array.rev
        |> String    
    str = rStr
               
let A,B = 
    let t = Console.ReadLine().Split()
            |> Array.map(int)
    t.[0],t.[1]

[A..B]
|> List.map (fun x -> x.ToString())
|> List.where(fun x -> isPalindromic x)
|> List.length
|> printfn "%i"
