import Control.Applicative ((<$>))
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.List (unfoldr)
import Data.Char (isSpace)

main :: IO ()
main = getLine >> solve <$> readil B.readInt <$> B.getLine >>= print

solve :: [Int] -> Int
solve = sum . map (subtract 1)

readil :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> [a]
readil f = unfoldr g
  where g s = do
          (n, s') <- f s
          return (n, B.dropWhile isSpace s')
