#pragma GCC optimize("O3")
#include <stdio.h>
#include <bits/stdc++.h>

int main()
{
	int i, N, A[2][131072];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(A[0][i]));
	for (i = 1; i <= N; i++) scanf("%d", &(A[1][i]));
	
	int j, k, l, r;
	const long long inf = -(1LL << 60);
	long long dp[2][131072];
	for (i = 0; i <= N; i++) {
		dp[0][i] = inf;
		dp[1][i] = inf;
	}
	dp[0][1] = A[0][1];
	dp[1][1] = A[1][1];
	for (i = 2; i <= N; i++) {
		if (i % 2 == 0) {
			dp[0][0] = dp[0][1] + A[0][i];
			if (dp[0][0] < dp[1][1] + A[1][i]) dp[0][0] = dp[1][1] + A[1][i];
		} else dp[1][0] = dp[0][0];
		k = (i < N - i)? i: N - i;
		l = i % 2;
		r = 1 - i % 2;
        long long ar = A[r][i], al = A[l][i];
        #pragma unroll(8)
		for (j = 2 - l; j <= k; j += 2) {
			dp[0][j] = std::max(dp[0][j-1] + ar, dp[0][j+1] + al);
			dp[1][j] = std::max(dp[1][j-1] + al, dp[1][j+1] + ar);
		}
	}
	printf("%lld\n", dp[0][0]);
	fflush(stdout);
	return 0;
}
#include<bits/stdc++.h>
typedef long long ll;
ll gi(){
	ll x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch))f^=ch=='-',ch=getchar();
	while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
	return f?x:-x;
}
#define all(x) (x).begin(),(x).end()
template<class T>void cxk(T&a,T b){a=a>b?a:b;}
template<class T>void cnk(T&a,T b){a=a<b?a:b;}
int a[100010],b[100010];
std::vector<ll>A,B;
int main(){
#ifdef LOCAL
	freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);
#endif
	int n=gi();
	ll sa=0;
	for(int i=1;i<=n;++i)sa+=a[i]=gi();
	for(int i=1;i<=n;++i)b[i]=gi()-a[i];
	A.resize(n/2+1),B.resize(n/2+1);
	for(int i=1,j=1;i<=n;i+=2,++j)A[j]=b[i],B[j]=b[i+1];
	std::sort(A.begin()+1,A.end(),std::greater<ll>());
	std::sort(B.begin()+1,B.end(),std::greater<ll>());
	for(int i=1;i<=n/2;++i)A[i]+=A[i-1],B[i]+=B[i-1];
	ll ans=0;for(int i=0;i<=n/2;++i)cxk(ans,A[i]+B[i]);
	printf("%lld\n",ans+sa);
	return 0;
}
