#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long

using namespace std;


int main()
{
    ios_base::sync_with_stdio(false);

    int n; cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    for(int i = 0; i < n; i++) cin >> b[i];
    cout << *max_element(b.begin(), b.end()) << endl;

    return 0;
}