#include <bits/stdc++.h>
#define fi first
#define se second
#define lc (x << 1)
#define rc (x << 1 | 1)
#define gc getchar() //(p1==p2&&(p2=(p1=buf)+fread(buf,1,size,stdin),p1==p2)?EOF:*p1++)
#define mk make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define IT iterator
#define V vector
#define TP template <class o>
#define TPP template <typename t1, typename t2>
#define SZ(a) ((int)a.size())
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define REP(i, a, b) for (int i = b; i >= a; i--)
#define FOR(i,n) rep(i,1,n)
#define debug(x) cerr << #x << ' ' << '=' << ' ' << x << endl
using namespace std;
typedef unsigned ui;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
const int N = 2e5 + 10, size = 1 << 20, mod = 998244353, inf = 2e9;
const ll INF = 1e15;

// char buf[size],*p1=buf,*p2=buf;
TP void qr(o& x) {
    char c = gc;
    x = 0;
    int f = 1;
    while (!isdigit(c)) {
        if (c == '-')
            f = -1;
        c = gc;
    }
    while (isdigit(c))
        x = x * 10 + c - '0', c = gc;
    x *= f;
}
TP void qw(o x) {
    if (x / 10)
        qw(x / 10);
    putchar(x % 10 + '0');
}
TP void pr1(o x) {
    if (x < 0)
        x = -x, putchar('-');
    qw(x);
    putchar(' ');
}
TP void pr2(o x) {
    if (x < 0)
        x = -x, putchar('-');
    qw(x);
    putchar(10);
}

// math
ll gcd(ll a, ll b) { return !a ? b : gcd(b % a, a); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll power(ll a, ll b = mod - 2, ll p = mod) {
    ll c = 1;
    while (b) {
        if (b & 1)
            c = c * a % p;
        b /= 2;
        a = a * a % p;
    }
    return c;
}

TP void cmax(o& x, o y) {
    if (x < y)
        x = y;
}
void cmax(int& x, int y) { x = x - y >> 31 ? y : x; }
TP void cmin(o& x, o y) {
    if (x > y)
        x = y;
}
void cmin(int& x, int y) { x = x - y >> 31 ? x : y; }
TPP void ad(t1& x, t2 y) {
    x += y;
    if (x >= mod)
        x -= mod;
}
TPP void dl(t1& x, t2 y) {
    x -= y;
    if (x < 0)
        x += mod;
}

// dbinom
ll jc[N], inv[N];
void jc_init(int n) {
    jc[0] = 1;
    for (int i = 1; i <= n; i++)
        jc[i] = jc[i - 1] * i % mod;
    inv[n] = power(jc[n]);
    for (int i = n; i; i--)
        inv[i - 1] = inv[i] * i % mod;
}
ll C(int x, int y) {
    if (x < y || y < 0)
        return 0;
    return jc[x] * inv[y] % mod * inv[x - y] % mod;
}

int n, a[N], b[N];
ll ans, c[2][N];

void solve() {
    qr(n);
    FOR(i,n) qr(a[i]),ans += a[i];
    FOR(i,n) qr(b[i]),c[i&1][(i+1)>>1]=b[i]-a[i];
    sort(c[0]+1,c[0]+n/2+1);
    sort(c[1]+1,c[1]+n/2+1);
    REP(i,1,n/2) {
        ll x=c[0][i]+c[1][i];
        if(x<0) break;
        ans += x;
    }
    pr2(ans);
}

int main() {
    int T = 1;
    // qr(T);
    while (T--)
        solve();
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define DEBUG

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
    os << '{';
    string sep;
    for (const auto &x : v) os << sep << x, sep = ", ";
    return os << '}';
}

template<typename T, size_t size>
ostream &operator<<(ostream &os, const array<T, size> &arr) {
    os << '{';
    string sep;
    for (const auto &x : arr) os << sep << x, sep = ", ";
    return os << '}';
}

template<typename A, typename B>
ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void dbg_out() { cerr << endl; }

template<typename Head, typename... Tail>
void dbg_out(Head H, Tail... T) {
    cerr << ' ' << H;
    dbg_out(T...);
}

#ifdef DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif

#define Long long long

const long long INF = 0x3f3f3f3f3f3f3f3fLL;
//const int MOD = 1e9 + 7;
const int MOD = 998244353;

/*
mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

int randomInt(int lim) {
    return uniform_int_distribution<int>(0, lim - 1)(rng);
}
*/

const int N = 15;
const int LOG = 18;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    vector<int> a(n), b(n);
    Long ans = 0;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> b[i], ans += b[i];
    vector<int> e, o;
    for (int i = 0; i < n; i++) {
        if (i & 1) o.push_back(a[i] - b[i]);
        else e.push_back(a[i] - b[i]);
    }
    sort(o.rbegin(), o.rend());
    sort(e.rbegin(), e.rend());
    Long cur = ans;
    for (int i = 0; i < n / 2; i++) {
        cur += o[i] + e[i];
        ans = max(ans, cur);
    }
    cout << ans << '\n';
}