import qualified Data.ByteString.Char8 as BC import Data.Maybe(fromJust) main :: IO () main = BC.getLine >> BC.getLine >>= print.sum.map (fst.fromJust.BC.readInt).BC.words