import Data.Char
main :: IO ()
main = do
  [n,a,b] <- map read . words <$> getLine  :: IO [Int]
  let xs = filter (\x -> let d = digs x in d>=a && d<=b) [1..n] 
  print $ sum xs

digs :: Int -> Int
digs = sum . map digitToInt . show