#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << '\n'; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin, n;
    auto a = make_v(2, n / 2, 0LL);
    auto b = make_v(2, n / 2, 0LL);
    ll score = 0;
    REP(i, 0, n) {
        cin, a[i % 2][i / 2];
    }
    REP(i, 0, n) {
        cin, b[i % 2][i / 2];
        score += b[i % 2][i / 2];
    }

    auto idx = make_v(2, n / 2, 0);

    REP(t, 0, 2) {
        iota(idx[t].begin(), idx[t].end(), 0);
        sort(idx[t].begin(), idx[t].end(), [&](int i, int j) {
            return a[t][i] - b[t][i] > a[t][j] - b[t][j];
        });
    }
    ll ans = score;
    REP(i, 0, n / 2 + 1) {
        dump(ans, score);
        chmax(ans, score);
        if (i < n / 2) {
            REP(t, 0, 2) {
                score -= b[t][idx[t][i]];
                score += a[t][idx[t][i]];
            }
        }
    }
    print(ans);

    return 0;
}

#include <stdio.h>
#include <bits/stdc++.h>

int main()
{
	int i, N, A[2][100001];
	scanf("%d", &N);
	for (i = 1; i <= N; i++) scanf("%d", &(A[0][i]));
	for (i = 1; i <= N; i++) scanf("%d", &(A[1][i]));
	
	int j, k, l, r;
	const long long inf = -(1LL << 60);
	long long dp[2][100001];
	for (i = 0; i <= N; i++) {
		dp[0][i] = inf;
		dp[1][i] = inf;
	}
	dp[0][1] = A[0][1];
	dp[1][1] = A[1][1];
	for (i = 2; i <= N; i++) {
		if (i % 2 == 0) {
			dp[0][0] = dp[0][1] + A[0][i];
			if (dp[0][0] < dp[1][1] + A[1][i]) dp[0][0] = dp[1][1] + A[1][i];
		} else dp[1][0] = dp[0][0];
		k = (i < N - i)? i: N - i;
		l = i % 2;
		r = 1 - i % 2;
		for (j = 2 - l; j <= k; j += 2) {
			dp[0][j] = dp[0][j-1] + A[r][i];
			if (dp[0][j] < dp[0][j+1] + A[l][i]) dp[0][j] = dp[0][j+1] + A[l][i];
			dp[1][j] = dp[1][j-1] + A[l][i];
			if (dp[1][j] < dp[1][j+1] + A[r][i]) dp[1][j] = dp[1][j+1] + A[r][i];
		}
	}
	printf("%lld\n", dp[0][0]);
	fflush(stdout);
	return 0;
}