import qualified Data.ByteString.Lazy.Char8 as B
import Data.Attoparsec.ByteString.Char8

main :: IO ()
main = do
  Right (n, as) <- parseOnly inputParser <$> B.getContents
  print $ solve n as

inputParser :: Parser (Int, [Int])
inputParser = (,)
  <$> decimal <* endOfLine
  <*> decimal `sepBy` space

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