main = do contents <- getContents print . sum $ map toInt (lines contents) toInt :: String -> Int toInt (x:xs) = if x == '+' then read xs :: Int else -(read xs :: Int)