#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<vector<long long> > ht(2, vector<long long>(n, 0));
  for (int i = 0; i < n; ++i) cin >> ht[0][i];
  for (int i = 0; i < n; ++i) cin >> ht[1][i];
  vector<vector<long long> > dp(3, vector<long long>(n, 0));
  dp[0][0] = ht[0][0];
  dp[1][0] = ht[1][0];
  dp[2][0] = 0;
  for (int i = 1; i < n; ++i) {
    dp[0][i] = ht[0][i] + max(dp[1][i - 1], dp[2][i - 1]);
    dp[1][i] = ht[1][i] + max(dp[0][i - 1], dp[2][i - 1]);
    dp[2][i] = max(dp[1][i - 1], dp[0][i - 1]);
  }
  cout << max(dp[0][n - 1], max(dp[1][n - 1], dp[2][n - 1])) << "\n";
  return 0;
}
