import Data.List
import Data.Ord

main = print . solve . tuplify . map read . drop 1 . words =<< getContents

tuplify [] = []
tuplify (x:y:xs) = (x,y):tuplify xs

solve :: [(Int,Int)] -> Int
solve = (\(f,s) -> f+s) . maximumBy (comparing fst)
