import Monad;main=liftM2(foldr$zipWith($))getLine(getContents>>=(return.map(map f).lines))>>=putStr;f ' '=id;f '+'=succ;f '-'=pred