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

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

(println (some-sums (read) (read) (read)))