let n, a, b = Scanf.scanf " %d %d %d" @@ fun a b c -> a, b, c
let rec f n = if n = 0 then 0 else n mod 10 + f (n / 10)
let ans = ref 0
let _ =
  for i = 1 to n do let s = f i in if a <= s && s <= b then ans := !ans + i done;
  Printf.printf "%d\n" !ans