solve :: Integer -> Integer -> Integer -> Integer -> Integer -> Integer 
solve a b left right x
 | right - left < 2 = left
 | x < eval = solve a b left ave x
 | eval <= x  = solve a b ave right x 
   where ave  = (left + right) `div` 2
         eval = a * ave + (b * toInteger (length (show ave)))
main = do
 [a,b,x] <- map read . words <$> getLine :: IO [Integer]
 print $ solve a b 0 1000000001 x