#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007;
void solve() {
  long long n;
  cin >> n;
  long long a[n + 1], b[n + 1];
  long long dp[n + 1][3];
  for (long long i = 1; i <= n; i++) cin >> a[i];
  for (long long i = 1; i <= n; i++) cin >> b[i];
  if (n == 1) {
    cout << max(a[1], b[1]);
    return;
  }
  dp[1][1] = a[1];
  dp[1][2] = b[1];
  dp[2][1] = b[1] + a[2];
  dp[2][2] = a[1] + b[2];
  long long ans = max(dp[2][1], dp[2][2]);
  for (long long i = 3; i <= n; i++) {
    dp[i][1] = a[i] + max(dp[i - 1][2], dp[i - 2][2]);
    dp[i][2] = b[i] + max(dp[i - 1][1], dp[i - 2][1]);
    ans = max(ans, dp[i][1]);
    ans = max(ans, dp[i][2]);
  }
  cout << ans;
  return;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
