//Hello,I'm Mitsubachi.
//This is a test. This code is made by my friend's macbook.

#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
#define fi first
#define se second

int main(){
  int n;
  cin>>n;
  ll a[n],b[n];
  ll ans=0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    ans+=a[i];
  }
  for(int i=0;i<n;i++){
    cin>>b[i];
  }
  vector<ll> even,odd;
  for(int i=0;i<n;i++){
    if(i%2==0){
      even.push_back(b[i]-a[i]);
    }
    else{
      odd.push_back(b[i]-a[i]);
    }
  }
  sort(even.begin(),even.end());
  reverse(even.begin(),even.end());
  sort(odd.begin(),odd.end());
  reverse(odd.begin(),odd.end());
  ll answer=ans;
  for(int i=0;i<n/2;i++){
    ans+=even[i]+odd[i];
    answer=max(answer,ans);
  }
  cout<<answer<<endl;
}
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}
#ifdef LOCAL
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cerr<<(*i)<<" ";cerr<<endl;}
#else
template<class T>void pv(T a,T b){}
#endif

ll nextLong() { ll x; scanf("%lld", &x); return x;}

const ll INF = 1LL << 61;
const int MAX_N = 112345;
ll dp[MAX_N][3];

int main2() {

  int N = nextLong();
  vector<ll> A(N), B(N);
  REP(i, N) A[i] = nextLong();
  REP(i, N) B[i] = nextLong();

  ll s = accumulate(ALL(A), 0LL);

  vector<ll> c0, c1;
  REP(i, N) {
    if (i % 2 == 0) c0.push_back(B[i] - A[i]);
    if (i % 2 == 1) c1.push_back(B[i] - A[i]);
  }
  sort(ALL(c0)); reverse(ALL(c0));
  sort(ALL(c1)); reverse(ALL(c1));

  ll ans = s;
  REP(i, c0.size()) {
    ll gain = c0[i] + c1[i];
    if (gain > 0) ans += gain;
    else break;
  }

  cout << ans << endl;
  return 0;
}

int main() {

#ifdef LOCAL
  for (;!cin.eof();cin>>ws)
#endif
    main2();
  return 0;
}
