
open Scanf
open Printf

let flip f x y = f y x

let rec range a b = if a >= b then [] else a :: range (a+1) b

let read_int () = scanf " %d" (fun x -> x)
let rec read_ints n = if n = 0 then [] else let i = read_int () in i :: read_ints (n-1)

let rec for_iter a b f = if a >= b then [] else let x = f a in x :: for_iter (a+1) b f

let () =
  let n = read_int () in let a = read_int() in let b = read_int () in
  for_iter 0 (n+1) (fun i ->
    let v, w, x, y, z = i/10000, (i/1000) mod 10, (i/100) mod 10, (i/10) mod 10, i mod 10 in
    let s = v+w+x+y+z in
    if a <= s && s <= b then i else 0)
  |> List.fold_left (+) 0
  |> printf "%d\n"
