defmodule Main do
  def main do
    [a, b] =
      IO.read(:line)
      |> String.trim
      |> String.split(" ")
    a = String.to_integer(a)
    b = String.to_integer(b)
    IO.puts(a..b |> Enum.to_list |> Enum.filter(fn x -> Integer.digits(x) == Enum.reverse(Integer.digits(x)) end) |> length)
  end
end
