#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long ll;
const int Maxn=100000;
int n;
int a[Maxn+5],b[Maxn+5];
int c[Maxn+5],d[Maxn+5];
bool cmp(int p,int q){
	return p>q;
}
int main(){
	scanf("%d",&n);
	ll ans=0;
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
		ans+=a[i];
	}
	for(int i=1;i<=n;i++){
		scanf("%d",&b[i]);
	}
	for(int i=1;i<=n;i++){
		if(i&1){
			c[(i+1)>>1]=b[i]-a[i];
		}
		else{
			d[i>>1]=b[i]-a[i];
		}
	}
	sort(c+1,c+1+(n>>1),cmp);
	sort(d+1,d+1+(n>>1),cmp);
	for(int i=1;i<=(n>>1);i++){
		if(c[i]+d[i]>0){
			ans+=c[i]+d[i];
		}
	}
	printf("%lld\n",ans);
	return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
#define Swap(a,b) (a+=b,b=a-b,a-=b)
static inline void PUT(char c)
{
  static char buf[1<<15],*ptr=buf;
  if(ptr==buf+strlen(buf)||c==0){fwrite(buf,1,ptr-buf,stdout),ptr=buf;}*ptr++=c;
}
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline void OUT(long a)
{
  if(a<0)PUT('-'),a=-a;
  int d[40],i=0;do{d[i++]=a%10;}while(a/=10);
  while(i--){PUT(d[i]+48);}PUT('\n');
}
static inline void AscRadix32(int *a,const int sz,const int minus)
{
  int x,shift=0,elem[0400],temp[sz];
  while(shift<040)
  {
    int bucket[0400]={0};
    rep(i,sz){x=(a[i]>>shift)&0377;bucket[x]++;temp[i]=a[i];}
    elem[0]=0;rep(i,0377)elem[i+1]=elem[i]+bucket[i];
    rep(i,sz){x=(temp[i]>>shift)&0377;a[elem[x]]=temp[i];elem[x]++;}
    shift+=010;
  }
  rep(i,minus>>1)Swap(a[sz-minus+i],a[sz-1-i]);
  rep(i,(sz-minus)>>1)Swap(a[i],a[sz-minus-1-i]);
  rep(i,sz>>1)Swap(a[i],a[sz-1-i]);
}
int main()
{
  int N=IN(),A[N],B[N],m1=0,m2=0,p1[N/2],p2[N/2];long score=0;
  rep(i,N){A[i]=IN(),score+=A[i];}rep(i,N){B[i]=IN();}
  rep(i,N)if(i&1){p1[i/2]=B[i]-A[i];if(B[i]-A[i]<0)m1++;}else{p2[i/2]=B[i]-A[i];if(B[i]-A[i]<0)m2++;}
  AscRadix32(p1,N/2,m1);AscRadix32(p2,N/2,m2);
  rep(i,N>>1)if(p1[(N>>1)-1-i]+p2[(N>>1)-1-i]>0)score+=p1[(N>>1)-1-i]+p2[(N>>1)-1-i];
  return OUT(score),0;
}