let () = Scanf.scanf "%d %d %d" @@ fun n a b ->
  Array.init n (fun i ->
    let s = string_of_int @@ i + 1 in
    Array.init (String.length s) (fun i -> Char.code s.[i] - Char.code '0')
    |> Array.fold_left ( + ) 0
    |> (fun n -> if a <= n && n <= b then i + 1 else 0))
  |> Array.fold_left ( + ) 0
  |> Printf.printf "%d\n"