import qualified Data.ByteString.Char8 as B
import Data.List (unfoldr)
import Data.Char (isSpace)

main :: IO ()
main = B.interact
  $ B.pack
  . show
  . solve
  . unfoldr (B.readInt . B.dropWhile isSpace)

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