#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
const int inf = 1000000000;
string s;
long long n, m, k;
long long dp[100001][3];
vector<long long> u, d;
long long solv(int ind, int U, long long last) {
  if (ind >= n) return 0;
  if (dp[ind][U] != -1) return dp[ind][U];
  if (U == 2) {
    long long ans = u[ind] + solv(ind + 1, 0, u[ind]);
    ans = max(ans, d[ind] + solv(ind + 1, 1, d[ind]));
    return ans;
  }
  if (U == 1) {
    long long ans = 0;
    ans = u[ind] + solv(ind + 1, 0, u[ind]);
    ans = max(ans, solv(ind + 1, 2, 0));
    return dp[ind][U] = ans;
  }
  if (U == 0) {
    long long ans = 0;
    ans = d[ind] + solv(ind + 1, 1, d[ind]);
    ans = max(ans, solv(ind + 1, 2, 0));
    return dp[ind][U] = ans;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(dp, -1, sizeof dp);
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    u.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    d.push_back(x);
  }
  cout << solv(0, 2, 0) << endl;
  return 0;
}
