#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 1000000000000000000

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int tt=1;
	//cin >> tt;
	while(tt--)
	{
		int n;
		cin >> n;
		int a[n],b[n];
		for(int i=0;i<n;i++)
			cin >> a[i];
		for(int i=0;i<n;i++)
			cin >> b[i];
		pair<int,int> odd[n/2], even[n/2];
		for(int i=0;i<n;i++)
		{
			if(i%2==0)
				even[i/2]={a[i]-b[i],i};
			else
				odd[i/2]={a[i]-b[i],i};
		}
		sort(even,even+n/2);
		sort(odd,odd+n/2);
		int ans=0;
		for(int i=n/2-1;i>=0;i--)
		{
			if(even[i].first+odd[i].first>=0)
			{
				ans+=a[even[i].second]+a[odd[i].second];
			}
			else
			{
				ans+=b[even[i].second]+b[odd[i].second];
			}
		}
		cout << ans << endl;
	}
	return 0;
}
#include<bits/stdc++.h> 
using namespace std;
namespace Ruri{
    #define ms(a,b) memset(a,b,sizeof(a))
    #define repi(i,a,b) for(int i=a,bbb=b;i<=bbb;++i)//attention reg int or reg ll ?
    #define repd(i,a,b) for(int i=a,bbb=b;i>=bbb;--i)
    #define reps(s) for(int i=head[s],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
    #define ce(i,r) i==r?'\n':' '
    #define pb push_back 
    #define all(x) x.begin(),x.end()
    #define gmn(a,b) a=min(a,b)
    #define gmx(a,b) a=max(a,b)
    #define fi first
    #define se second                         
    typedef long long ll;
    typedef unsigned long long ull;
    typedef double db;
    const int infi=1e9;//infi较大，注意涉及inf相加时爆int
    const ll infl=4e18;
    inline ll ceil_div(ll a,ll b){ return (a+b-1)/b; }
    inline ll pos_mod(ll a,ll b){ return (a%b+b)%b; }
    //std::mt19937 rnd(time(0));//std::mt19937_64 rnd(time(0));
}
using namespace Ruri;
namespace Read{
    #define ss(a) scanf("%s",a)
    inline int ri(){ int x; scanf("%d",&x); return x; }
    inline ll rl(){ ll x;  scanf("%lld",&x); return x; }
    inline db rd(){ db x; scanf("%lf",&x); return x; }
}
namespace DeBug{
    #define pr(x) cout<<#x<<": "<<(x)<<endl
    #define pra(x,a,b) cout<<#x<<": "<<endl; \
            repi(i,a,b) cout<<x[i]<<" ";     \
            puts("");   
    #define FR(a) freopen(a,"r",stdin)
    #define FO(a) freopen(a,"w",stdout)
}
using namespace Read;
using namespace DeBug;
const int MAX_N=1e5+5;
int n;
ll a[MAX_N],b[MAX_N];
vector<ll> rec[2];
int main()
{
	n=ri();
	ll ans=0;
	repi(i,1,n) a[i]=ri();
	repi(i,1,n) b[i]=ri(),ans+=b[i];
	
	repi(i,1,n) rec[i&1].pb(a[i]-b[i]);
	sort(all(rec[0])),sort(all(rec[1]));
	repi(i,0,n/2-1) ans+=max(0ll,rec[0][i]+rec[1][i]);
	printf("%lld\n",ans);
    return 0;
}
