let rec sumDigit ret N =
  if N<10 then
    ret+N
  else
    sumDigit (ret + N%10) (N/10)

let check a b x = a<=x && x<=b

stdin.ReadLine().Split(' ')
|> Array.map int
|> fun [|N;A;B|] -> List.filter ((check A B) << (sumDigit 0)) [1..N]
|> List.sum
|> printfn "%d"