#include <bits/stdc++.h>
using namespace std;

const int MAXN = 110;
int n, a[MAXN], b[MAXN];
pair <int, int> c[MAXN];

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    freopen("text.inp", "r", stdin);
    freopen("text.out", "w", stdout);

    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i] >> b[i];
        c[i] = {a[i], b[i]};
    }

    sort(c + 1, c + 1 + n);
    int res = 0;
    for (int i = 1; i <= n; i++) {
        if (res < c[i].first) res = c[i].first + c[i].second;
        else res += c[i].second;
    }

    cout << res;

    return 0;
}