import qualified Data.ByteString.Char8 as BC import Data.Maybe(fromJust) main :: IO () main = BC.getContents >>= print.sum.map (fst.fromJust.BC.readInteger).tail.BC.lines