(defn find-sum-of-digits [n]
  (reduce + (map #(- % 48) (map #(int %) (seq (format "%d" n))))))

(defn some-sums [arr]
  (let [n (nth arr 0)
        a (nth arr 1)
        b (nth arr 2)]
    (reduce +
      (for [i (range 1 (inc n))
        :when (>= (find-sum-of-digits i) a)
        :when (<= (find-sum-of-digits i) b)] i))))

(defn create-data [s]
  (map #(Long/parseLong %) (.split s " ")))

(println (some-sums (create-data (read-line))))