#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
int N;
cin >> N;
//<도착시간, 검문시간>
vector<pair<int, int>> time;
for (int i = 0; i < N; ++i) {
int t1, t2;
cin >> t1 >> t2;
time.push_back({ t1, t2 });
}
//도착시간 기준 오름차순 정렬
sort(time.begin(), time.end());
int endTime = 0;
for (int i = 0; i < N; ++i) {
endTime = max(endTime, time[i].first);
endTime += time[i].second;
}
cout << endTime;
return 0;
}