import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

main :: IO ()
main = B.interact
  $ B.pack
  . show
  . solve
  . map (fst . fromJust . B.readInt)
  . B.words

solve :: [Int] -> Int
solve (n:as) = -n + sum as
