import Data.Char (digitToInt)

main :: IO ()
main = do
    [n,a,b] <- map read .words <$> getLine
    print . sum $ nums n a b

nums :: Int -> Int -> Int -> [Int]
nums n a b = filter (between a b . sumDigits) [1..n]

between :: Ord a => a -> a -> a -> Bool
between a b s = a <= s && s <= b

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