import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int[][] A = new int[2][N];
		A[0] = nextIntArray(sc, N);
		A[1] = nextIntArray(sc, N);

		sc.close();

		int[][] dp = new int[2][N];
		dp[0][0] = A[0][0];
		dp[1][0] = dp[0][0] + A[1][0];

		for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		}

		out.println(dp[1][N - 1]);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int[][] A = new int[2][N];
		A[0] = nextIntArray(sc, N);
		A[1] = nextIntArray(sc, N);

		sc.close();

		int[][] dp = new int[2][N];
		dp[0][0] = A[0][0];
		dp[1][0] = dp[0][0] + A[1][0];

		for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		}

		out.println(dp[1][N - 1]);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int[][] A = new int[2][N];
		A[0] = nextIntArray(sc, N);
		A[1] = nextIntArray(sc, N);

		sc.close();

		int[][] dp = new int[2][N];
		dp[0][0] = A[0][0];
		dp[1][0] = dp[0][0] + A[1][0];

		for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		}

		out.println(dp[1][N - 1]);

	} _main {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int[][] A = new int[2][N];
		A[0] = nextIntArray(sc, N);
		A[1] = nextIntArray(sc, N);

		sc.close();

		int[][] dp = new int[2][N];
		dp[0][0] = A[0][0];
		dp[1][0] = dp[0][0] + A[1][0];

		for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		}

		out.println(dp[1][N - 1]);

	} Scanner sc = new Scanner(in); sc new Scanner(in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int[][] A = new int[2][N]; A new int[2][N] 2 N A[0] = nextIntArray(sc, N) A[0] A 0 nextIntArray(sc, N) nextIntArray sc N A[1] = nextIntArray(sc, N) A[1] A 1 nextIntArray(sc, N) nextIntArray sc N sc.close() sc.close sc int[][] dp = new int[2][N]; dp new int[2][N] 2 N dp[0][0] = A[0][0] dp[0][0] dp[0] dp 0 0 A[0][0] A[0] A 0 0 dp[1][0] = dp[0][0] + A[1][0] dp[1][0] dp[1] dp 1 0 dp[0][0] + A[1][0] dp[0][0] dp[0] dp 0 0 A[1][0] A[1] A 1 0 for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		} int i = 1; int i = 1; i 1 i < N i N i++ i++ i {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		} {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		} dp[0][i] = dp[0][i - 1] + A[0][i] dp[0][i] dp[0] dp 0 i dp[0][i - 1] + A[0][i] dp[0][i - 1] dp[0] dp 0 i - 1 i 1 A[0][i] A[0] A 0 i dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i] dp[1][i] dp[1] dp 1 i Math.max(dp[0][i], dp[1][i - 1]) + A[1][i] Math.max(dp[0][i], dp[1][i - 1]) Math.max Math dp[0][i] dp[0] dp 0 i dp[1][i - 1] dp[1] dp 1 i - 1 i 1 A[1][i] A[1] A 1 i out.println(dp[1][N - 1]) out.println out dp[1][N - 1] dp[1] dp 1 N - 1 N 1 String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args @SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} nextIntArray {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	} int[] result = new int[n]; result new int[n] n for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			result[i] = sc.nextInt();
		} {
			result[i] = sc.nextInt();
		} result[i] = sc.nextInt() result[i] result i sc.nextInt() sc.nextInt sc return result; result Scanner sc sc int n n public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int[][] A = new int[2][N];
		A[0] = nextIntArray(sc, N);
		A[1] = nextIntArray(sc, N);

		sc.close();

		int[][] dp = new int[2][N];
		dp[0][0] = A[0][0];
		dp[1][0] = dp[0][0] + A[1][0];

		for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		}

		out.println(dp[1][N - 1]);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int[][] A = new int[2][N];
		A[0] = nextIntArray(sc, N);
		A[1] = nextIntArray(sc, N);

		sc.close();

		int[][] dp = new int[2][N];
		dp[0][0] = A[0][0];
		dp[1][0] = dp[0][0] + A[1][0];

		for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		}

		out.println(dp[1][N - 1]);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int N = sc.nextInt();
		int[][] A = new int[2][N];
		A[0] = nextIntArray(sc, N);
		A[1] = nextIntArray(sc, N);

		sc.close();

		int[][] dp = new int[2][N];
		dp[0][0] = A[0][0];
		dp[1][0] = dp[0][0] + A[1][0];

		for (int i = 1; i < N; i++) {
			dp[0][i] = dp[0][i - 1] + A[0][i];
			dp[1][i] = Math.max(dp[0][i], dp[1][i - 1]) + A[1][i];
		}

		out.println(dp[1][N - 1]);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}

	@SuppressWarnings("unused")
	private int[] nextIntArray(Scanner sc, int n) {
		int[] result = new int[n];
		for (int i = 0; i < n; i++) {
			result[i] = sc.nextInt();
		}
		return result;
	}
}
