import Control.Applicative ((<$>)) main :: IO () main = do _ <- getLine xs <- map read . words <$> getLine v <- readLn print $ sum xs - v