import Data.Char

decider::Int->Int->Int->Bool
decider a b n = let m = (sum.(map digitToInt).show) n in
                (a<=m)&&(m<=b)

naive_solver::Int->Int->Int->Int
naive_solver n a b = sum (filter (decider a b) [1..n])

main::IO()
main=do
  nabc<-getLine
  let n:a:b:[]=map read (words nabc)
  print (naive_solver n a b)