#include <bits/stdc++.h>
#define ll long long
#define el cout << '\n'
#define co_tat_ca_nhung_thieu_em using namespace std;
#define ngay_xua_em_che_toi_code_ga ios_base::sync_with_stdio(0);
#define bay_gio_toi_da_ga_hon cin.tie(0);
#define em_da_thay_hoi_han_chua cout.tie(0);
#define __QuocSensei__ int main()
co_tat_ca_nhung_thieu_em;
const int maxn = 1e5;
int n;
ll a[maxn + 10][2], dp[maxn + 10][2];
__QuocSensei__
{
ngay_xua_em_che_toi_code_ga
bay_gio_toi_da_ga_hon
em_da_thay_hoi_han_chua
if (fopen("GHEN.INP", "r"))
{
freopen("GHEN.INP", "r", stdin);
freopen("GHEN.OUT", "w", stdout);
}
cin >> n;
for (int i = 1; i <= n; i++) cin >> a[i][0];
for (int i = 1; i <= n; i++) cin >> a[i][1];
dp[1][0] = a[1][0];
dp[1][1] = a[1][1];
for (int i = 2; i <= n; i++)
for (int j = 0; j <= 1; j++)
dp[i][j] = max(dp[i-1][!j], dp[i-2][!j] + a[i-1][j]) + a[i][j];
cout << max(dp[n][0], dp[n][1]);
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CgojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIGVsIGNvdXQgPDwgJ1xuJwojZGVmaW5lIGNvX3RhdF9jYV9uaHVuZ190aGlldV9lbSB1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIG5nYXlfeHVhX2VtX2NoZV90b2lfY29kZV9nYSBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApOwojZGVmaW5lIGJheV9naW9fdG9pX2RhX2dhX2hvbiBjaW4udGllKDApOwojZGVmaW5lIGVtX2RhX3RoYXlfaG9pX2hhbl9jaHVhIGNvdXQudGllKDApOwojZGVmaW5lIF9fUXVvY1NlbnNlaV9fIGludCBtYWluKCkKCmNvX3RhdF9jYV9uaHVuZ190aGlldV9lbTsKCmNvbnN0IGludCBtYXhuID0gMWU1OwoKaW50IG47CmxsIGFbbWF4biArID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