main :: IO ()
main = do
    [n,a,b] <- map read . words <$> getLine    
    putStrLn (show $ godFizzNa n a b)  

goffi :: Int -> Int
goffi n = (div n 10000) + (div n 1000 - 10 * div n 10000) + (div n 100 - 10 * div n 1000) + (div n 10 - 10* div n 100)+ div n 1 - 10* div n 10

pittan :: Int -> Int -> Int -> Bool
pittan i a b =  if a<=i && i<=b then True
                else False

pikosan :: Int -> Bool -> Int
pikosan x y =   if y then x
                else 0

godFizzNa :: Int -> Int -> Int -> Int
godFizzNa n a b =   if n == -1 then 0
                    else pikosan n (pittan (goffi n) a b) + godFizzNa (n-1) a b