// Arup Guha
// 2/16/2017
// Solution to 2017 February USACO Bronze Problem: Why Did the Cow Cross the Road III?

import java.util.*;
import java.io.*;

public class cowqueue {

	public static void main(String[] args) throws Exception {

		// Read input.
		Scanner stdin = new Scanner(new File("cowqueue.in"));
		int n = stdin.nextInt();
		item[] list = new item[n];

		// Read and sort list by start time.
		for (int i=0; i<n; i++) {
			int start = stdin.nextInt();
			int dur = stdin.nextInt();
			list[i] = new item(start, dur);
		}
		Arrays.sort(list);

		// Just simulate.
		int curT = 0;
		for (int i=0; i<n; i++) {
			curT = Math.max(curT, list[i].start);
			curT += list[i].duration;
		}

		// Output the result.
		PrintWriter out = new PrintWriter(new FileWriter("cowqueue.out"));
		out.println(curT);
		out.close();
		stdin.close();
	}
}

class item implements Comparable<item> {

	public int start;
	public int duration;

	public item(int s, int d) {
		start = s;
		duration = d;
	}

	public int compareTo(item other) {
		return this.start - other.start;
	}
}