#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  long long n;
  cin >> n;
  vector<long long> a(n), b(n);
  for (long long i = 0; i < n; ++i) cin >> a[i];
  for (long long i = 0; i < n; ++i) cin >> b[i];
  vector<vector<long long>> dp(n, vector<long long>(3));
  dp[0][0] = a[0];
  dp[0][1] = b[0];
  for (long long i = 1; i < n; ++i) {
    dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + a[i];
    dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + b[i];
    dp[i][2] = max(dp[i - 1][0], max(dp[i - 1][1], dp[i - 1][2]));
  }
  cout << max(max(dp[n - 1][0], dp[n - 1][1]), dp[n - 1][2]);
  return 0;
}
