import Data.List
import Data.Ord
import Data.Char
import Data.Ratio
import Data.Maybe

main = do
  [n,a,b] <- map (read::String->Int) . words <$> getLine
  print $ sum [x|x<-[1..n], let y=(sum .map digitToInt .show)x, a<=y, y<=b]