import Data.Char
 
main :: IO ()
main = do
    [n, a, b] <- (map read) . words <$> getLine
    let results = (\i -> (i, (sum . (map digitToInt) . show) i)) <$> [1..n]
    print . sum $ map fst $ filter (\i -> (snd i)>=a && (snd i)<=b) results