let fold_int f a n =
  let rec fold f a i n =
    if i >= n then
      a
    else
      fold f (f a i) (i + 1) n
  in
    fold f a 0 n

let int_of_digit c = int_of_char c - 48 (* 48 = int_of_char '0' *)

let sum_digits n =
  let s = string_of_int n in
  fold_int
    (fun sum i -> sum + int_of_digit s.[i])
    0
    (String.length s)

let solve n a b =
  fold_int
    (fun sum i ->
      let i = i + 1 in
      let d = sum_digits i in
      sum + if a <= d && d <= b then i else 0)
    0
    n

let read_ints () = read_line () |> Str.split (Str.regexp " ") |> List.map int_of_string

let _ =
  match read_ints () with
  | [n; a; b] -> solve n a b |> string_of_int |> print_endline
  | _ -> ()