#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main() {
// your code goes here
ll n;
cin>>n;
ll arr1[n+1]={0},arr2[n+1]={0};
ll i=1;
while(i<=n)
{
cin>>arr1[i];
i++;
}
i=1;
while(i<=n)
{
cin>>arr2[i];
i++;
}
ll dp[n+1]={0};
ll k=0;
dp[1]=max(arr1[1],max(arr2[1],k));
dp[2]=max(dp[1],max(arr1[2],arr2[2]));
i=3;
while(i<=n)
{
ll x= arr1[i]+dp[i-2];
ll y = arr2[i]+dp[i-2];
ll z = dp[i-1];
dp[i]=max(x,max(y,z)); //trick to find max of 3 numbers
// cout<<i<<" "<<dp[i]<<"\n";
i++;
}
cout<<dp[n];
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGludCBsbDsKCmludCBtYWluKCkgewoJLy8geW91ciBjb2RlIGdvZXMgaGVyZQoJCglsbCBuOwoJY2luPj5uOwoJbGwgYXJyMVtuKzFdPXswfSxhcnIyW24rMV09ezB9OwoJbGwgaT0xOwoJd2hpbGUoaTw9bikKCSB7CgkgCWNpbj4+YXJyMVtpXTsKCSAJaSsrOwoJIH0KCSBpPTE7Cgkgd2hpbGUoaTw9bikKCSAgewoJICAJY2luPj5hcnIyW2ldOwoJICAJaSsrOwoJICB9CgkgIAoJICBsbCBkcFtuKzFdPXswfTsKCSAgbGwgaz0wOwoJICBkcFsxXT1tYXgoYXJyMVsxXSxtYXgoYXJyMlsxXSxrKSk7CgkgIGRwWzJdPW1heChkcFsxXSxtYXgoYXJyMVsyXSxhcnIyWzJdKSk7CgkgIAoJICBpPTM7CgkgIHdoaWxlKGk8PW4pCgkgICB7CgkgICAJbGwgeD0gYXJyMVtpXStkcFtpLTJdOwoJICAgCWxsIHkgPSBhcnIyW2ldK2RwW2ktMl07CgkgICAJbGwgeiA9IGRwW2ktMV07CgkgICAJZHBbaV09bWF4KHgsbWF4KHkseikpOyAgLy90cmljayB0byBmaW5kIG1heCBvZiAzIG51bWJlcnMKCSAgIC8vIGNvdXQ8PGk8PCIgIjw8ZHBbaV08PCJcbiI7CgkgICAJaSsrOwoJICAgfQoJICAgY291dDw8ZHBbbl07CglyZXR1cm4gMDsKfQ==