'use strict'
 
function Main(input) {
    var line = input.split('\n');
    line = line.pop();
    line = line.shift();
    let low = 0;
    let min = 0;
    for (let i = 1; i < line.length; i++) {
        const arg = line[i].split(' ');
        if (arg[0] > lowest) {
            low = parseInt( arg[0] , 10);
            min = parseInt( arg[1] , 10);
        }
    }
    console.log(low + min);
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));