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