import Control.Applicative ((<$>), (<*>))
 
main :: IO ()
main = print =<< solve <$> getLine <*> getLine
 
solve :: String -> String -> Int
solve r' g' = 2 * g - r
  where r = read r' :: Int
        g = read g' :: Int