#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
ll A[101010],B[101010];
vector<ll> V[2];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) cin>>A[i];
	FOR(i,N) cin>>B[i];
	
	ll tsum=0;
	for(i=0;i<N;i+=2) {
		ll a=max(A[i]+A[i+1],B[i]+B[i+1]);
		tsum+=a;
		V[0].push_back(A[i]+B[i+1]-a);
		V[1].push_back(B[i]+A[i+1]-a);
	}
	ll ret=tsum;
	
	sort(ALL(V[0]));
	sort(ALL(V[1]));
	reverse(ALL(V[0]));
	reverse(ALL(V[1]));
	
	FOR(i,N/4) {
		tsum+=V[0][i]+V[1][i];
		ret=max(ret,tsum);
		
	}
	
	
	cout<<ret<<endl;
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}

#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define all(v) v.begin(),v.end()
#pragma gcc optimize("O3")
#pragma gcc optimize("Ofast") 
#pragma gcc optimize("unroll-loops")
using namespace std;
const int INF = 1e9;
const long long llINF = 5e18;
long long mod;
typedef long long ll;
typedef long double ld;
typedef pair <int,int> pi;
typedef pair <ll,ll> pl;
typedef vector <int> vec;
typedef vector <pi> vecpi; 
typedef long long ll;
int n;
int a[100005],b[100005];

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> n;
	for(int i = 1;i <= n;i++) cin >> a[i];
	for(int i = 1;i <= n;i++) cin >> b[i];
	ll ans = 0;
	for(int i = 1;i <= n;i++) {
		if((i & 1) == 0) swap(a[i],b[i]);
		ans += a[i];
		b[i] -= a[i];
	}
	sort(b+1,b+n+1);
	reverse(b+1,b+n+1);
	for(int i = 1;i <= n/2;i++) ans += b[i];
	cout << ans;
}