import qualified Data.ByteString.Char8 as B
import Data.ByteString.Char8 (ByteString)
import Control.Monad.Trans.State.Strict
import Control.Applicative
import Data.Char

main :: IO ()
main = B.interact $ output . solve . input

output :: Int -> ByteString
output = B.pack . show

solve : [Int] -> Int
solve = sum . map pred

input :: ByteString -> [Int]
input = evalStateT $  parseInt *> (many parseInt)
  where
    parseInt = StateT $ B.readInt . dropWhile isSpace


