import Control.Monad.ST import Control.Monad import Data.Array.ST import Data.Array import Data.STRef import Control.Monad import Control.Applicative import Data.List main = do getLine a <- map read <$> words <$> getLine ::IO [Integer] b <- readLn::IO Integer print $ (sum a) - b