//	Totally unrelated and not AT ALL stolen from hohohaha's, generic_placeholder_name's or katoriyuu's template
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include <ext/rope>

using namespace std;

#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define gcd __gcd
#define rep(i,s,end) for(int i = (s); i <  (end); ++i)
#define rep1(i, end) for(int i =   1; i <= (end); ++i)
#define lb lower_bound
#define ub upper_bound

#define vt vector
#define endl "\n"

#define fileopen(filename, in_type, out_type) if (fopen(filename in_type, "r")) {freopen(filename in_type, "r", stdin);freopen(filename out_type, "w", stdout);}
#define local_input(x) if (x && fopen("input.txt","r")) freopen("input.txt","r",stdin);
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

#define fscan(x)   scanf("%d",  &x)
#define fscandb(x) scanf("%lf", &x)
#define fscanll(x) scanf("%lld",&x)
//	Until next time, remember:
//			You are closer than you think.
//						_Dan Lok_

typedef double db;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
#define pi 3.1415926535897932	//faster than pi = acos(-1); but sometimes doesn't work?
//	srand(chrono::steady_clock::now().time_since_epoch().count());
//	freopen("input.txt","r",stdin);

template<typename flow_t>
struct flow_edge{
	int from,v;
	flow_t flow,cap,cost;
	flow_edge() {}
	flow_edge(const int& From, const int& V, const flow_t& capacity, const flow_t& price, const flow_t& passing_flow) : from(From), v(V), flow(passing_flow), cap(capacity), cost(price) {}
};
template<typename flow_t>
ostream& operator << (ostream &stream, const flow_edge<flow_t>& e){
	return stream << e.from << "--->" << e.v << " with (" << e.flow << '/' << e.cap << ')';
}
template<typename flow_t>
class flow_graph{
	flow_t T_MAX = std::numeric_limits<flow_t>::max();
	int n;
	vector<flow_t> d;
	vector<int> p,pe;
	vector<bool> inq;
	queue<int> q;
public:
	vector< vector<int> > adjlist;
	vector< flow_edge<flow_t> > edge;
	
	flow_graph() : n(0) {}
	flow_graph(const int& N) : n(N), adjlist(N) {}
	
	void add(const int &u, const int &v, const flow_t& cap = (flow_t)1, const flow_t& cost = 0, const flow_t& currflow = 0)
	{
		adjlist[u].pb(edge.size());	edge.pb(flow_edge<flow_t>(u,v, cap, cost, currflow));
		adjlist[v].pb(edge.size());	edge.pb(flow_edge<flow_t>(v,u,   0,-cost,-currflow));
	}
	int add_node(){adjlist.emplace_back(vector<int>()); return n++;}
	
/*		For Push-Relabel Max_flow:
			d : excess array;
			pe: height array;
			p : count  array;
*/
	void enQueue(const int& u){
		if (!inq[u] && d[u] > 0) q.push(u), inq[u] = true;
	}
	
	void Push(const int& edge_idx)
	{
		flow_edge<flow_t> &e = edge[edge_idx];
		flow_t to_push = min(e.cap-e.flow, d[e.from]);
		
		if (to_push > 0 && pe[e.from] > pe[e.v]){
			edge[ edge_idx ].flow += to_push;
			edge[edge_idx^1].flow -= to_push;
			
			d[e.v]    += to_push;
			d[e.from] -= to_push;
			
			enQueue(e.v);
		}
	}
	
	void Relabel(int u)
	{
		p[ pe[u] ] -= 1; pe[u] = (n << 1) - 2;
		for(int& j : adjlist[u]){
			flow_edge<flow_t> &e = edge[j];
			if (e.cap > e.flow) pe[u] = min(pe[u], pe[e.v]);
		}
		p[++pe[u]] += 1;
	}
	
	void gapRelabel(int height)
	{
		for(int u = 0; u < n; ++u){
			if (pe[u] >= height && pe[u] < n){
				p[  pe[u]  ] -= 1;
				p[pe[u] = n] += 1;
				enQueue(u);
			}
		}
	}
	
	void Discharge(int u)
	{
		for(int& j : adjlist[u]){
			if (d[u] <= 0) break; Push(j);
		}
		if (d[u] > 0){
			if (pe[u] < n && p[pe[u]] < 2) gapRelabel(pe[u]);
			else Relabel(u);
		}
		else if (!q.empty()){
			q.pop(); inq[u] = false;
		}
	}
	
	flow_t max_flow(const int& s, const int& t)
	{
		d.assign(n,0), p.assign(n << 1,0), pe.assign(n,0), inq.assign(n,false);
		pe[s] = n, inq[s] = inq[t] = true, p[0] = n - (p[n] = 1);
		for(int& j : adjlist[s]){
			d[s] += edge[j].cap; Push(j);
		}
		while(!q.empty()) Discharge(q.front());
		return d[t];
	}
	
	void SPFA(const int& v0)
	{
		d.assign(n, T_MAX), p.assign(n, -1), pe.assign(n, -1), inq.assign(n,false); 
		q.push(v0), d[v0] = 0, inq[v0] = true;
		
		while(!q.empty())
		{
			int u = q.front(); q.pop();
			for(int& i: adjlist[u])
			{
				flow_edge<flow_t> &e = edge[i];
				if (e.flow != e.cap && d[e.v] > d[u] + e.cost) 
				{
					if (e.v != u) p[e.v] = u;
					d[e.v] = d[u] + e.cost,
					pe[e.v] = i;
					if (!inq[e.v])
					{
						inq[e.v] = true;
						q.push(e.v);
					}
				}
			}
			inq[u] = false;
		}
	}
	
	pair<flow_t,flow_t> min_cost(const int& s, const int& t, bool maxFlow = true)
//	returns a {cost, flow} pair;
	{
		if (s != t)
		{
			flow_t cost = 0, flow = 0; 
			while(true)
			{
				SPFA(s);
				if (maxFlow)
				{
					if(d[t] == T_MAX) break;
				}
				else 
				{
					if (d[t] >= 0) break;
				}
				
				flow_t f = T_MAX;
				int curr = t;
				
				while(curr != s)
				{
					f = min(f, flow_t(edge[pe[curr]].cap-edge[pe[curr]].flow));
					curr = p[curr];
				}
				
				flow += f, 
				cost += f * d[t];

				curr = t;
				while(curr != s)
				{
					edge[pe[curr]].flow   += f,
					edge[pe[curr]^1].flow -= f;
					curr = p[curr];
				}
			}
			return {cost,flow};
		}
		return {-1,-1};
	}
	
	flow_t min_cost_K_flow(const int& s, const int& t, flow_t K)
//	returns the minimum cost amongst all flows from s->t with flow value K, 
	{
		if (s != t)
		{
			flow_t cost = 0, flow = 0;
			while(flow < K)
			{
				SPFA(s);
				if (p[t] == -1) break;
				
				flow_t f = K - flow;
				int curr = t;
				
				while(curr != s)
				{
					f = min(f, edge[pe[curr]].cap-edge[pe[curr]].flow);
					curr = p[curr];
				}
				
				flow += f;
				cost += f * d[t];
				
				curr = t;
				while(curr != s)
				{
					edge[pe[curr]].flow   += f,
					edge[pe[curr]^1].flow -= f;
					curr = p[curr];
				}
			}
			return cost;
		}
		return -1;
	}
	
	flow_t max_flow_K_cost(const int& s, const int& t, flow_t K)
//	returns the maximum flow for a cost no more than K 
	{
		if (s != t)
		{
			flow_t cost = 0, flow = 0;
			while(true)
			{
				SPFA(s);
				if(d[t] == T_MAX) break;
				
				flow_t f = T_MAX;
				int curr = t;
				
				while(curr != s)
				{
					f = min(f, edge[pe[curr]].cap-edge[pe[curr]].flow);
					curr = p[curr];
				}
				
				if (d[t] > 0) f = min(f, (K-cost)/d[t]);
				if (f == 0) break;
				
				flow += f;
				cost += f * d[t];
				
				curr = t;
				while(curr != s)
				{
					edge[pe[curr]].flow   += f,
					edge[pe[curr]^1].flow -= f;
					curr = p[curr];
				}
			}
			return flow;
		}
		return -1;
	}
};

#define mn 101
int n;
int a[2][101];
int p[2][101];

signed main()
{
	fastio;
//	fileopen("",".inp",".out");
	local_input(true);
	const int st = 0, sink = 1;
	flow_graph<int> g(2);
	cin >> n;
	rep(j,0,n){
		cin >> a[0][j];
		p[0][j] = g.add_node();
		if(j){
			g.add(p[0][j-1], p[0][j], 1, -a[0][j]);
		}
	}
	rep(j,0,n){
		cin >> a[1][j];
		p[1][j] = g.add_node();
		if(j){
			g.add(p[1][j-1], p[1][j], 1, -a[1][j]);
		}
		g.add(p[0][j], p[1][j], 1, -a[1][j]);
	}
	g.add(st,p[0][0], 1, -a[0][0]),
	g.add(p[1][n-1], sink, 1);
	cout << -g.min_cost(st,sink).fi << endl;
		
	return 0;
}
// with the aura of Dora, AC!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// Why is there a one in my row of exclamation marks?


Measured memory_bytes: 3672