#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
using namespace std;
long long MOD = 998244353;
double eps = 1e-12;
void solve() {
  long long n;
  cin >> n;
  long long r1[n], r2[n];
  for (long long i = 0; i < n; i++) {
    cin >> r1[i];
  }
  for (long long i = 0; i < n; i++) {
    cin >> r2[i];
  }
  long long dp[3][n];
  long long f = 1, s = 2, p = 0;
  dp[f][0] = r1[0];
  dp[s][0] = r2[0];
  dp[p][0] = 0;
  for (long long i = 1; i < n; i++) {
    dp[p][i] = max({dp[f][i - 1], dp[p][i - 1], dp[s][i - 1]});
    dp[f][i] = r1[i] + max(dp[s][i - 1], dp[p][i - 1]);
    dp[s][i] = r2[i] + max(dp[f][i - 1], dp[p][i - 1]);
  }
  cout << max({dp[f][n - 1], dp[s][n - 1], dp[p][n - 1]}) << endl;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  for (int it = 1; it <= t; it++) {
    solve();
  }
  return 0;
}
