import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.to!(int[]);
}

int calc(int[][] xs) {
    int n = cast(int) xs[0].length;

    auto dp = new int[][](2, n);
    dp[0][0] = xs[0][0];
    for (int i = 1; i < n; i++) {
        dp[0][i] = xs[0][i] + dp[0][i - 1];
    }

    dp[1][0] = xs[1][0] + dp[0][0];
    for (int i = 1; i < n; i++) {
        dp[1][i] = xs[1][i] + max(dp[0][i], dp[1][i - 1]);
    }

    return dp[1][n - 1];
}

void main() {
    readint;

    int[][] xs;
    xs ~= readints;
    xs ~= readints;

    int ans = calc(xs);
    writeln(ans);

}
