import Data.Char

main = do
  (n:a:b:_) <- getLine >>= return . map read . words :: IO [Int]

  print $ sum $ filter (\x -> let y = f x in a<=y && y<=b) [1..n]
  where
    f x = sum $ map (\c -> ord c - ord '0') (show x)
