main = do getLine as <- map read . words <$> getLine v <- readLn print (sum as - v)