import Control.Applicative ((<$>)) main :: IO () main = solve <$> map read <$> words <$> getLine >>= print solve :: [Int] -> Int solve [b1, b2, b3] = b2 + (b3 - b1) * (b3 - b2) `div` (b2 - b1)