import Data.Char

f::String->Int->Int->Bool
f m a b=let c=sum (map digitToInt m)
        in a<=c && c<=b
  

main = do
       e<-getLine
       let (n:a:b:[])=map read (words e)::[Int]
       putStrLn $ show $ sum $ [m|m<-[1..n],f (show m) a b] 