let rec sum_of_digits x res =
  if x = 0 then res else
  sum_of_digits (x/10) (res+x mod 10)

let solve n a b =
  let rec count m res =
    if m > n then res else
    let s = sum_of_digits m 0 in
    count (m+1) (res + if a <= s && s <= b then m else 0)
  in
  count 1 0

let () =
  Scanf.scanf "%d %d %d\n" @@ fun n a b -> 
  Printf.printf "%d\n" @@ solve n a b