#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int i, j = 0, r = 200, p, q, k = 1000000007, ans = 0, d, y = 0, h,
                   f = 0, n, m = 0, a, b, id, c, h1, h2, a1, b1;
  cin >> n;
  vector<long long int> v(n), vc(n);
  for (i = 0; i < n; i++) cin >> v[i];
  for (i = 0; i < n; i++) cin >> vc[i];
  long long int dp[n + 1][2];
  memset((dp), 0, sizeof(dp));
  dp[0][0] = v[0];
  dp[0][1] = vc[0];
  if (n > 1) {
    dp[1][0] = max(dp[0][0], dp[0][1] + v[1]);
    dp[1][1] = max(dp[0][0] + vc[1], dp[0][1]);
  }
  for (i = 2; i < n; i++) {
    dp[i][0] =
        max(dp[i - 1][1] + v[i], max(dp[i - 2][0] + v[i], dp[i - 2][1] + v[i]));
    dp[i][1] = max(dp[i - 1][0] + vc[i],
                   max(dp[i - 2][1] + vc[i], dp[i - 2][0] + vc[i]));
  }
  cout << max(dp[n - 1][0], dp[n - 1][1]);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) solve();
}
