(defmacro input []
  '(->> (clojure.string/split (read-line) #"\s")
     (map #(Integer/parseInt %))))

(defn PalindromicNumbers [[A B]]
  (->> (range A (inc B))
    (filter
      #(let [n (str %)] (= n (clojure.string/reverse n))))
    count))

(-> (input)
  PalindromicNumbers
  println)