#include <bits/stdc++.h>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
//const int mod = ;

int main() {
  std::ios::sync_with_stdio(false); std::cin.tie(0);
  int n;
  cin >> n;
  vl a(n), b(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  for (int i = 0; i < n; ++i) cin >> b[i];
  vi ts(n);
  ll sum = 0;
  for (int i = 0; i < n; ++i) {
    ll add = i % 2 ? a[i] : b[i];
    sum += add;
    ts[i] = a[i] + b[i] - 2 * add;
  }
  sort(ts.rbegin(), ts.rend());
  for (int i = 0; i < n / 2; ++i) sum += ts[i];
  cout << sum << '\n';
  return 0;
}

#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

const int MOD=1000000007;
const int INF=0x3f3f3f3f;
const ll INFL=0x3f3f3f3f3f3f3f3f;

ll a[200000],b[200000];

int main(){
	int n;cin>>n;
	rep(i,n)scanf("%lld",&a[i]);
	rep(i,n)scanf("%lld",&b[i]);
	vector<ll>u,v;
	rep(i,n){
		if(i%2==0)v.push_back(b[i]-a[i]);
		else u.push_back(b[i]-a[i]);
	}
	ll sum=0;
	rep(i,n)sum+=a[i];
	sort(v.begin(),v.end(),greater<>());
	sort(u.begin(),u.end(),greater<>());
	ll Max=sum;
	for(int i=0;i<v.size();i++){
		sum+=v[i]+u[i];
		Max=max(Max,sum);
	}
	cout<<Max<<endl;
}
/*
[([(())])(([]))]
*/