/*
						   _________________
					  ____/:::::::::::::::::\_____
				   __/::::::::::::::::::::::::::::\___
				 _/:::::::::::::::::::::::::::::::::::\__
			   _/::::::::::::::::::::::::::::::::::::::::\_
			  /::::::::::::::::::::::::::::::::::::::::::::\
			 |::::::::::::::::::::::::::::::::::::::::::::::\
			/::::::::::::::::::::::::::::::::::::::::::::::::\
		   |:::/.:::::::;:::::::::::::::::::::::::::::::::::::|
		  /:::/.:::::::/..:::::::::::::::::::::::::::::::::::::\
		 |:::|.::::::;/.::::::::::::::::::::::::::::::::::::::::|
		 |::/.::::::/..:::::::;;'.::::::::::::::::::::::::::::::|
		 |:|.::::/./.::::::;;/..:::::::::::::::::::::::::::::::::|
		 `:|.:::|.|.:::::;/..;;;;;;-'.:;;;-':::::::::::::::::::::|
		  \|.:::|.|.:::;/.;;/  -..::'''...:::::::::::::::::::::::|
		   \;;::|.|.::/.;/--__      |::::::::::::::::::::::::::::|
			  \;;\\::/|/ =-__ --_  /::::::::::::::::::::::::::::::
				  \\/    /|  -.   |.::::::::::::::::::::::::::::::
				 _.'    /|'   /=  ||::::::::::::::::::::::::::::::
			 _.-'      //'        ||::::::::::::::::::::::::::::::
			(          -          `|::::::::::::::::::::::::::::::
			 \                      \:::::::::::::::::::::::::::::
			  |  (c)Kolansburg      \::::::::::::::::::::::::::::
			 /                      __/:::::::::::::::::::::::::::
			 \                   __/::;::;;:::::::::::::::::::::::
			 (`                 /;;;;/::|  \::::::::::::::::::::::
			 |                 |'_,::::/ \ |::::::::::::::::::::::
			.'                _/::::::/  / /:::::::::::::::. .::::
			|                /.::;;:-'_)/_/::::::::::::::::...::::
 ----.__    |               |.::|   \___/::::::::::::::::::...::::
 :::::::`----\_____          \:::\.-'::::::::::::::::::::::...::::
 ;;;;;:::::::::::::`------     \:::::::::::::::::::::::::::...::::
	  `-------:::::::\         /:::::::::::::::::::::::::::...::::
 ___.--------'::::::::\       |::::::::::::::::::::::::::::...::::
 :::::;;;:--:::::::::::|      /::::::::::::::::::::::::::::...::::
 ----'  _,-:.:::::::::::\    |.::::::::::::::::::::::::::::...::::
	 __/.::::::::::::::::|   |.::::::::::::::::::::::::::::...::::
  __/.:::;;::::::::;/.:::|   |.::::::::::::::::::::::::::::. .::::
 /.::::;/ /.:::::;/ |.::::|   \_.:::::::::::::::::::::::::::::::::
 :::::/  /.:::::/  /.:::::|     \__.::::::::::::::::::::::::::::::
 ::::|  |.:::::/  /.:::::.|        \,::::::::::::::::::::::::::::
 ::::|  |.::::|   |.:::::/|       __/::::::::::::::::::::::::::::
 \.:::\  \.:::|   |.::::||| __.--::::::::::::::::::::::::::::::::
  \.:::\_ \.:::\   \.:::'/.::::::::::::::::::::::::::::::::::::::
   \.::::\ \.:::\   \.::::::::::::::::::::::::::::::::::::::::::
*/

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <set>
#include <map>
#include <queue>
#include <ctime>
#include <cmath>
#include <math.h>
#include <stack>
#include <random>
#include <bitset>
#include <string>
#include <vector>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
#include <unordered_map>

using namespace std;

#define X first
#define Y second

const int MAXN = 2010, M = 1000000007;

long long n, a[MAXN][2], dp[MAXN][2];

int main()
{
#if _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	//freopen("power.in", "r", stdin);
	//freopen("power.out", "w", stdout);
#endif
	ios_base::sync_with_stdio(0);
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i][0];
	}
	for (int i = 0; i < n; i++)
	{
		cin >> a[i][1];
	}
	dp[0][0] = a[0][0];
	for (int i = 1; i < n; i++)
	{
		dp[i][0] = dp[i - 1][0] + a[i][0];
	}
	dp[0][1] = a[0][1] + dp[0][0];
	for (int i = 1; i < n; i++)
	{
		dp[i][1] = max(dp[i - 1][1], dp[i][0]) + a[i][1];
	}
	cout << dp[n - 1][1];
	return 0;
}

Measured memory_bytes: 256