#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
const long long MOD = 1000000007;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<vector<long long>> a(2, vector<long long>(n));
  for (auto &v : a)
    for (auto &x : v) cin >> x;
  vector<vector<long long>> dp(2, vector<long long>(n));
  long long ans = 0;
  dp[0][0] = a[0][0];
  ans = max(ans, dp[0][0]);
  dp[1][0] = a[1][0];
  ans = max(ans, dp[1][0]);
  if (n >= 2) {
    dp[0][1] = a[0][1] + dp[1][0];
    ans = max(ans, dp[0][1]);
    dp[1][1] = a[1][1] + dp[0][0];
    ans = max(ans, dp[1][1]);
  }
  for (long long i = 2; i < n; i++) {
    dp[0][i] = max(dp[0][i], dp[1][i - 1] + a[0][i]);
    dp[0][i] = max(dp[0][i], dp[0][i - 2] + a[0][i]);
    dp[0][i] = max(dp[0][i], dp[1][i - 2] + a[0][i]);
    dp[1][i] = max(dp[1][i], dp[0][i - 1] + a[1][i]);
    dp[1][i] = max(dp[1][i], dp[1][i - 2] + a[1][i]);
    dp[1][i] = max(dp[1][i], dp[0][i - 2] + a[1][i]);
    ans = max(ans, dp[0][i]);
    ans = max(ans, dp[1][i]);
  }
  cout << ans << '\n';
}
