import Data.Char

main :: IO()
main = do
  [n, a, b] <- map read . words <$> getLine
  let digitList = map (sum . map digitToInt) (map show [0..n])
  let isMatch x = fst x >= a && fst x <= b
  let filteredList = filter isMatch $ zip digitList [0..n]
  print $ sum $ map snd filteredList