import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int array[][] = new int[2+1][N+1];
        for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int dp[][] = new int[2+1][N+1];
        
        for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        }
        
        System.out.println( dp[2][N] );
        
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int array[][] = new int[2+1][N+1];
        for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int dp[][] = new int[2+1][N+1];
        
        for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        }
        
        System.out.println( dp[2][N] );
        
    }
} Main public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int array[][] = new int[2+1][N+1];
        for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int dp[][] = new int[2+1][N+1];
        
        for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        }
        
        System.out.println( dp[2][N] );
        
    } main {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int array[][] = new int[2+1][N+1];
        for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int dp[][] = new int[2+1][N+1];
        
        for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        }
        
        System.out.println( dp[2][N] );
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int array[][] = new int[2+1][N+1]; array new int[2+1][N+1] 2+1 2 1 N+1 N 1 for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        } int i = 1; int i = 1; i 1 i < 2+1 i 2+1 2 1 i++ i++ i {
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        } {
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        } for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            } int j = 1; int j = 1; j 1 j < N+1 j N+1 N 1 j++ j++ j {
                array[i][j] = sc.nextInt();
            } {
                array[i][j] = sc.nextInt();
            } array[i][j] = sc.nextInt() array[i][j] array[i] array i j sc.nextInt() sc.nextInt sc int dp[][] = new int[2+1][N+1]; dp new int[2+1][N+1] 2+1 2 1 N+1 N 1 for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        } int i = 1; int i = 1; i 1 i < 2+1 i 2+1 2 1 i++ i++ i {
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        } {
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        } for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            } int j = 1; int j = 1; j 1 j < N+1 j N+1 N 1 j++ j++ j {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            } {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            } dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] ) dp[i][j] dp[i] dp i j array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] ) array[i][j] array[i] array i j Math.max( dp[i][j-1], dp[i-1][j] ) Math.max Math dp[i][j-1] dp[i] dp i j-1 j 1 dp[i-1][j] dp[i-1] dp i-1 i 1 j System.out.println( dp[2][N] ) System.out.println System.out System System.out dp[2][N] dp[2] dp 2 N String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int array[][] = new int[2+1][N+1];
        for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int dp[][] = new int[2+1][N+1];
        
        for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        }
        
        System.out.println( dp[2][N] );
        
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int array[][] = new int[2+1][N+1];
        for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int dp[][] = new int[2+1][N+1];
        
        for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        }
        
        System.out.println( dp[2][N] );
        
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int array[][] = new int[2+1][N+1];
        for(int i = 1; i < 2+1; i++){
            for( int j = 1; j < N+1; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int dp[][] = new int[2+1][N+1];
        
        for( int i = 1; i < 2+1; i++ ){
            for( int j = 1; j < N+1; j++ ) {
                dp[i][j] = array[i][j] + Math.max( dp[i][j-1], dp[i-1][j] );
            }
        }
        
        System.out.println( dp[2][N] );
        
    }
}
