let get_3_ints () = Scanf.scanf "%d %d %d" (fun u v w -> u,v,w)
let range ?(stride=1) u v =
  let rec f0 i a = if i>v then a else f0 (i+stride) (i::a)
  in f0 u []
let digits v =
  let rec f0 p a = if p=0 then a else f0 (p/10) ((p mod 10)::a)
  in f0 v []

let () =
  let (n,a,b) = get_3_ints ()
  in range 1 n
  |> List.fold_left (fun u v ->
    let k = v |> digits |> List.fold_left (+) 0
    in if a<=k&&k<=b then u+v else u
  ) 0
  |> Printf.printf "%d\n"