#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e5+5;
int a[N],b[N];
int c[N],d[N];
signed main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;++i)
		cin>>a[i];
	for(int i=1;i<=n;++i)
		cin>>b[i];
	int sum=0,ans=0,m=(n>>1);
	for(int i=1;i<=n;++i){
		sum+=a[i];
		b[i]-=a[i];
		if(i&1) c[(i+1)/2]=b[i];
		else d[i/2]=b[i];
	}
	sort(c+1,c+m+1,greater<int>());
	sort(d+1,d+m+1,greater<int>());
	ans=sum;
	for(int i=1;i<=m;++i){
		sum+=c[i]+d[i];
		ans=max(ans,sum);
	}
	cout<<ans;
	return 0;
}
#include <bits/stdc++.h>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
using namespace std;

typedef long long ll;
typedef unsigned long long llu;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<int, pii> piii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;
typedef pair<string, int> psi;
typedef pair<char, int> pci;
typedef pair<int, char> pic;
const int MOD = 1e9 + 7;
const long double PI = 3.141592653589793238462643383279502884197;

ll fac[1] = {1}, inv[1] = {1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll mp(ll a,ll b){ll ret=1;while(b){if(b&1)ret=ret*a%MOD;a=a*a%MOD;b>>=1;}return ret;}
ll cmb(ll r, ll c) {return (c>r||c<0) ? 0:fac[r] * inv[c] % MOD * inv[r - c] % MOD;}

int main() {
    int n;
    scanf("%d", &n);

    map<int, int> ma;
    ll ans = 0;
    for (int i = 0; i < n; i++) {
        int t;
        scanf("%d", &t);
        t %= 200;

        ans += ma[t]++;
    }

    printf("%lld", ans);
}

// author: rdd6584
