#include<bits/stdc++.h>
using namespace std;
#define lll __int128_t
#define ll long long
#define int long long
#define FOR(i,a,b) for(ll i=a;i<(ll)b;i++)
#define FORr(i,a,b) for(ll i =a;i>=(ll)b;i--)
#define rep(i,n) FOR(i,0,n)
#define rep1(i,n) FOR(i,1,n)
#define print(arr)  for(auto a: arr) cout << a<< " "; cout << endl;
#define case(i) cout << "Case " << i << ": ";
#define in(a) ll a; cin >> a;
#define inp(arr,n) vector<ll>arr(n); for(auto &a: arr) cin >> a;
#define pb emplace_back
#define all(a) a.begin(), a.end()
#define mp make_pair
#define f first
#define vll vector<ll>
#define s second
ll mod = 1e9 + 7;
#define pll pair<ll, ll>
#define set_bit(x, idx) x = x|(1LL<<idx)
ll dx[8] = {0,1,0,-1,1,-1,1,-1};
ll dy[8] = {-1,0,1,0,1,1,-1,-1};
#define toggle_bit(x, idx) x = x^(1LL<<idx)
#define check_bit(x, idx) min(x&(1LL<<idx),1LL)
#define endl "\n"
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rng(x,y) uniform_int_distribution<int>(x,y)(rng)
template<typename T> ostream& operator<<(ostream &os, const multiset<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T> ostream& operator<<(ostream &os, const set<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
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...); }
#define db long double
ll hash58 = 288230376151711717;
ll hash32 = 1610612741;
#ifdef DEBUG
#define ios
#define dbg(...) cerr << __LINE__ << " : " ;cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__);
#define ok cerr << __LINE__ << " is done " << endl;
#else
#define ios ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define dbg(...)
#define ok
#endif

string one;
ll fact[5];
ll dp[12][6][30];

ll solve(ll idx, ll cnt, ll div){
    if(dp[idx][cnt][div] != -1) return dp[idx][cnt][div];
    if(idx == 10 ) {
        if(cnt) return 0;
        ll now = fact[4]/div;
        return dp[idx][cnt][div] = now;
    }
    ll ans = 0;
    if(one[idx] == 'o'){
        for(int i = 1; i <= cnt; i++){
            ans += solve(idx+1, cnt-i, div*fact[i]);
        }
    }
    else if(one[idx] == '?'){
        for(int i = 0; i <= cnt; i++){
            ans += solve(idx+1, cnt-i, div*fact[i]);
        }
    }
    else{
        ans = solve(idx+1, cnt, div);
    }
    return dp[idx][cnt][div] = ans;
}

void solvetc(ll tt){
    memset(dp, -1LL, sizeof dp);
    cin >> one;
    fact[0] = 1;
    rep1(i, 5) fact[i] = i*fact[i-1];
    cout << solve(0, 4, 1) << endl;
}

int32_t main()
{
    ios ;
    //freopen("in", "r", stdin);
    ll nn = 1;
    //cin >> nn;
    rep(i, nn) solvetc(i+1);
}
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;

int main(){
  int N;
  cin >> N;
  long long s = 0;
  vector<long long> A(N), B(N);
  for(int i = 0; i < N; ++i){
    cin >> A[i];
    s += A[i];
  }
  for(int i = 0; i < N; ++i){
    cin >> B[i];
  }
  vector<long long> O, E;
  for(int i = 0; i < N; ++i){
    long long d = B[i]-A[i];
    if(i%2) O.emplace_back(d);
    else E.emplace_back(d);
  }
  sort(O.rbegin(), O.rend());
  sort(E.rbegin(), E.rend());
  long long ans = s;
  for(int i = 0; i < N/2; ++i){
    s += O[i]+E[i];
    ans = max(ans,s);
  }
  cout << ans << endl;
}
