main = do getLine getContents >>= print . sum . map ((\(c:d:_) -> (c+1) `div` 2 * d) . map read . words) . lines