let () =
  let n,a,b = Scanf.scanf "%d %d %d " (fun a b c -> a,b,c) in

  let res = ref 0 in
  for i=1 to n do
    let cs = i |> string_of_int |> Batteries.String.to_list |> List.map (fun x -> int_of_char x - 48) in
    let sum = List.fold_left (+) 0 cs in
    if sum >= a && sum <= b then res := !res + i
  done;

  Printf.printf "%d\n" !res
