main = do getLine xs <- map read . words <$> getLine v <- read <$> getLine print $ sum xs - v