#include <bits/stdc++.h>
const long long mod = 1000000007;
const double PI = 3.14159265358979323846;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long* h1 = new long long[n];
  long long* h2 = new long long[n];
  for (long long i = 0; i < n; i++) cin >> h1[i];
  for (long long i = 0; i < n; i++) cin >> h2[i];
  long long** dp = new long long*[n];
  for (long long i = 0; i < n; i++) {
    dp[i] = new long long[3];
    for (long long j = 0; j < 3; j++) dp[i][j] = 0;
  }
  dp[0][0] = h1[0];
  dp[0][1] = h2[0];
  dp[0][2] = 0;
  for (long long i = 1; i < n; i++) {
    dp[i][0] = h1[i] + max(dp[i - 1][1], dp[i - 1][2]);
    dp[i][1] = h2[i] + max(dp[i - 1][0], dp[i - 1][2]);
    dp[i][2] = max(dp[i - 1][0], max(dp[i - 1][1], dp[i - 1][2]));
  }
  long long ans = max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2]));
  cout << ans;
  delete[] h1;
  delete[] h2;
  for (long long i = 0; i < n; i++) delete[] dp[i];
  delete[] dp;
}
