import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int N = r.i();
        int[][] candy = new int[2][N];
        candy[0] = r.ii();
        candy[1] = r.ii();
        int[][] dp = new int[2][N];
        dp[0][0] = candy[0][0];
        dp[1][0] = dp[0][0] + candy[1][0];
        for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        }
        println(dp[1][N-1]);
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int Int(String s){
            return Integer.parseInt(s);
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    }
} import java.io.*; io.* java public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int N = r.i();
        int[][] candy = new int[2][N];
        candy[0] = r.ii();
        candy[1] = r.ii();
        int[][] dp = new int[2][N];
        dp[0][0] = candy[0][0];
        dp[1][0] = dp[0][0] + candy[1][0];
        for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        }
        println(dp[1][N-1]);
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int Int(String s){
            return Integer.parseInt(s);
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    }
} Main public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int N = r.i();
        int[][] candy = new int[2][N];
        candy[0] = r.ii();
        candy[1] = r.ii();
        int[][] dp = new int[2][N];
        dp[0][0] = candy[0][0];
        dp[1][0] = dp[0][0] + candy[1][0];
        for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        }
        println(dp[1][N-1]);
    } main {
        Reader r = new Reader();
        int N = r.i();
        int[][] candy = new int[2][N];
        candy[0] = r.ii();
        candy[1] = r.ii();
        int[][] dp = new int[2][N];
        dp[0][0] = candy[0][0];
        dp[1][0] = dp[0][0] + candy[1][0];
        for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        }
        println(dp[1][N-1]);
    } Reader r = new Reader(); r new Reader() int N = r.i(); N r.i() r.i r int[][] candy = new int[2][N]; candy new int[2][N] 2 N candy[0] = r.ii() candy[0] candy 0 r.ii() r.ii r candy[1] = r.ii() candy[1] candy 1 r.ii() r.ii r int[][] dp = new int[2][N]; dp new int[2][N] 2 N dp[0][0] = candy[0][0] dp[0][0] dp[0] dp 0 0 candy[0][0] candy[0] candy 0 0 dp[1][0] = dp[0][0] + candy[1][0] dp[1][0] dp[1] dp 1 0 dp[0][0] + candy[1][0] dp[0][0] dp[0] dp 0 0 candy[1][0] candy[1] candy 1 0 for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        } int j = 1; int j = 1; j 1 j < N j N j++ j++ j {
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        } {
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        } dp[0][j] = dp[0][j-1]+candy[0][j] dp[0][j] dp[0] dp 0 j dp[0][j-1]+candy[0][j] dp[0][j-1] dp[0] dp 0 j-1 j 1 candy[0][j] candy[0] candy 0 j dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j] dp[1][j] dp[1] dp 1 j Math.max(dp[0][j], dp[1][j-1])+candy[1][j] Math.max(dp[0][j], dp[1][j-1]) Math.max Math dp[0][j] dp[0] dp 0 j dp[1][j-1] dp[1] dp 1 j-1 j 1 candy[1][j] candy[1] candy 1 j println(dp[1][N-1]) println dp[1][N-1] dp[1] dp 1 N-1 N 1 String[] args args static void print(Object o){
        System.out.print(o.toString());
    } print {
        System.out.print(o.toString());
    } System.out.print(o.toString()) System.out.print System.out System System.out o.toString() o.toString o Object o o static void println(Object o){
        System.out.println(o.toString());
    } println {
        System.out.println(o.toString());
    } System.out.println(o.toString()) System.out.println System.out System System.out o.toString() o.toString o Object o o static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int Int(String s){
            return Integer.parseInt(s);
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    } Reader Reader(){
            super(new InputStreamReader(System.in));
        } Reader {
            super(new InputStreamReader(System.in));
        } super(new InputStreamReader(System.in)) super new InputStreamReader(System.in) String s() throws IOException{
            return readLine();
        } s {
            return readLine();
        } return readLine(); readLine() readLine String[] ss() throws IOException{
            return s().split(" ");
        } ss {
            return s().split(" ");
        } return s().split(" "); s().split(" ") s().split s() s " " int Int(String s){
            return Integer.parseInt(s);
        } Int {
            return Integer.parseInt(s);
        } return Integer.parseInt(s); Integer.parseInt(s) Integer.parseInt Integer s String s s int i() throws IOException{
            return Int(s());
        } i {
            return Int(s());
        } return Int(s()); Int(s()) Int s() s int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        } ii {
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        } String[] ss = ss(); ss ss() ss int size = ss.length; size ss.length ss ss.length int[] ii = new int[size]; ii new int[size] size for(int j = 0; j < size; j++) ii[j] = Int(ss[j]); int j = 0; int j = 0; j 0 j < size j size j++ j++ j ii[j] = Int(ss[j]); ii[j] = Int(ss[j]) ii[j] ii j Int(ss[j]) Int ss[j] ss j return ii; ii BufferedReader public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int N = r.i();
        int[][] candy = new int[2][N];
        candy[0] = r.ii();
        candy[1] = r.ii();
        int[][] dp = new int[2][N];
        dp[0][0] = candy[0][0];
        dp[1][0] = dp[0][0] + candy[1][0];
        for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        }
        println(dp[1][N-1]);
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int Int(String s){
            return Integer.parseInt(s);
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    }
} public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int N = r.i();
        int[][] candy = new int[2][N];
        candy[0] = r.ii();
        candy[1] = r.ii();
        int[][] dp = new int[2][N];
        dp[0][0] = candy[0][0];
        dp[1][0] = dp[0][0] + candy[1][0];
        for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        }
        println(dp[1][N-1]);
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int Int(String s){
            return Integer.parseInt(s);
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    }
} Main
import java.io.*;
public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        int N = r.i();
        int[][] candy = new int[2][N];
        candy[0] = r.ii();
        candy[1] = r.ii();
        int[][] dp = new int[2][N];
        dp[0][0] = candy[0][0];
        dp[1][0] = dp[0][0] + candy[1][0];
        for(int j = 1; j < N; j++){
            dp[0][j] = dp[0][j-1]+candy[0][j];
            dp[1][j] = Math.max(dp[0][j], dp[1][j-1])+candy[1][j];
        }
        println(dp[1][N-1]);
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int Int(String s){
            return Integer.parseInt(s);
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
    }
}