#include <bits/stdc++.h>
using namespace std;
template <class T>
istream& operator>>(istream& in, vector<T>& a) {
  for (auto& i : a) in >> i;
  return in;
}
template <class T>
ostream& operator<<(ostream& out, vector<T>& a) {
  for (auto& i : a) out << i << " ";
  return out;
}
template <class T, class U>
istream& operator>>(istream& in, vector<pair<T, U>>& a) {
  for (auto& i : a) in >> i.first >> i.second;
  return in;
}
template <class T, class U>
ostream& operator<<(ostream& out, vector<pair<T, U>>& a) {
  for (auto& i : a) out << i.first << " " << i.second << endl;
  return out;
}
signed main() {
  long long n;
  cin >> n;
  vector<long long> a(n), b(n);
  cin >> a >> b;
  vector<vector<long long>> dp(n, vector<long long>(3, 0));
  dp[0][0] = a[0];
  dp[0][1] = b[0];
  dp[0][2] = 0;
  for (long long i = 1; i < n; ++i) {
    dp[i][0] = max(dp[i - 1][1] + a[i], dp[i - 1][2] + a[i]);
    dp[i][1] = max(dp[i - 1][0] + b[i], dp[i - 1][2] + b[i]);
    dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]);
  }
  cout << max(dp[n - 1][1], dp[n - 1][0]);
}
