#include <bits/stdc++.h>
#define int long long
using namespace std;
signed main()
{
    int n;
    cin >> n;
    
    
    int sol = -1;
    for(int i = 0; i <n; i++)
    {
        int a;
        cin >> a;
    }
     for(int i = 0; i <n; i++)
    {
        int a;
        cin >> a;
        sol = max(sol, a);
    }
    cout << sol;

    return 0;
}