

import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    static Scanner sc=new Scanner(System.in);
    static int count=0,res=0; 
    static int n=sc.nextInt();
    static int m=n;
    static int map[][]=new int[3][n+1];
 //   static int book[][]=new int[3][n+1];
    static int result[]=new int[2*n+1];
    public static void dfs(int count,int x,int y){
        if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;}
       if(x<0||x>2||y<0||y>n) return;
        System.out.println(count+" "+x+" "+y+" "+map[x][y]);
        result[res]+=map[x][y];
        count++;
        dfs(count,x+1,y);
        dfs(count,x,y+1);
        
         
    }
    public static void main(String[] args) {
        // TODO code application logic here
      //  Scanner sc=new Scanner(System.in);
        for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        }
        System.out.println(map[2][n]);
        //dfs(0,1,1);
//        int max=result[0];
//        for(int i=0;i<res;i++){
//            System.out.println(result[i]);
//            if(max<result[i])
//                max=result[i];
//        }
//        System.out.println(max);
//        
       
     
        


        }
        
    }
    
 import java.util.Scanner; Scanner java.util public class Main {

    /**
     * @param args the command line arguments
     */
    static Scanner sc=new Scanner(System.in);
    static int count=0,res=0; 
    static int n=sc.nextInt();
    static int m=n;
    static int map[][]=new int[3][n+1];
 //   static int book[][]=new int[3][n+1];
    static int result[]=new int[2*n+1];
    public static void dfs(int count,int x,int y){
        if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;}
       if(x<0||x>2||y<0||y>n) return;
        System.out.println(count+" "+x+" "+y+" "+map[x][y]);
        result[res]+=map[x][y];
        count++;
        dfs(count,x+1,y);
        dfs(count,x,y+1);
        
         
    }
    public static void main(String[] args) {
        // TODO code application logic here
      //  Scanner sc=new Scanner(System.in);
        for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        }
        System.out.println(map[2][n]);
        //dfs(0,1,1);
//        int max=result[0];
//        for(int i=0;i<res;i++){
//            System.out.println(result[i]);
//            if(max<result[i])
//                max=result[i];
//        }
//        System.out.println(max);
//        
       
     
        


        }
        
    } Main /**
     * @param args the command line arguments
     */
    static Scanner sc=new Scanner(System.in); sc new Scanner(System.in) static int count=0 count 0 res=0; res 0 static int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc static int m=n; m n static int map[][]=new int[3][n+1]; map new int[3][n+1] 3 n+1 n 1 //   static int book[][]=new int[3][n+1];
    static int result[]=new int[2*n+1]; result new int[2*n+1] 2*n+1 2*n 2 n 1 public static void dfs(int count,int x,int y){
        if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;}
       if(x<0||x>2||y<0||y>n) return;
        System.out.println(count+" "+x+" "+y+" "+map[x][y]);
        result[res]+=map[x][y];
        count++;
        dfs(count,x+1,y);
        dfs(count,x,y+1);
        
         
    } dfs {
        if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;}
       if(x<0||x>2||y<0||y>n) return;
        System.out.println(count+" "+x+" "+y+" "+map[x][y]);
        result[res]+=map[x][y];
        count++;
        dfs(count,x+1,y);
        dfs(count,x,y+1);
        
         
    } if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;} count==m+1 count m+1 m 1 {
           // if(res==0) m+=1;
            res++;  
            return;} res++ res return; if(x<0||x>2||y<0||y>n) return; x<0||x>2||y<0||y>n y<0 x<0||x>2||y<0||y>n x<0 x 0 x>2 x 2 y<0 y 0 y>n y n return; System.out.println(count+" "+x+" "+y+" "+map[x][y]) System.out.println System.out System System.out count+" "+x+" "+y+" "+map[x][y] " " y " " x count+" "+x+" "+y+" "+map[x][y] count " " x " " y " " map[x][y] map[x] map x y result[res]+=map[x][y] result[res] result res map[x][y] map[x] map x y count++ count dfs(count,x+1,y) dfs count x+1 x 1 y dfs(count,x,y+1) dfs count x y+1 y 1 int count count int x x int y y public static void main(String[] args) {
        // TODO code application logic here
      //  Scanner sc=new Scanner(System.in);
        for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        }
        System.out.println(map[2][n]);
        //dfs(0,1,1);
//        int max=result[0];
//        for(int i=0;i<res;i++){
//            System.out.println(result[i]);
//            if(max<result[i])
//                max=result[i];
//        }
//        System.out.println(max);
//        
       
     
        


        } main {
        // TODO code application logic here
      //  Scanner sc=new Scanner(System.in);
        for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        }
        System.out.println(map[2][n]);
        //dfs(0,1,1);
//        int max=result[0];
//        for(int i=0;i<res;i++){
//            System.out.println(result[i]);
//            if(max<result[i])
//                max=result[i];
//        }
//        System.out.println(max);
//        
       
     
        


        } for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        } int i=1; int i=1; i 1 i<=2 i 2 i++ i++ i {
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        } {
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        } for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            } int j=1; int j=1; j 1 j<=n j n j++ j++ j {
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            } {
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            } map[i][j]=sc.nextInt() map[i][j] map[i] map i j sc.nextInt() sc.nextInt sc map[i][j]+=Math.max(map[i-1][j],map[i][j-1]) map[i][j] map[i] map i j Math.max(map[i-1][j],map[i][j-1]) Math.max Math map[i-1][j] map[i-1] map i-1 i 1 j map[i][j-1] map[i] map i j-1 j 1 System.out.println(map[2][n]) System.out.println System.out System System.out map[2][n] map[2] map 2 n String[] args args public class Main {

    /**
     * @param args the command line arguments
     */
    static Scanner sc=new Scanner(System.in);
    static int count=0,res=0; 
    static int n=sc.nextInt();
    static int m=n;
    static int map[][]=new int[3][n+1];
 //   static int book[][]=new int[3][n+1];
    static int result[]=new int[2*n+1];
    public static void dfs(int count,int x,int y){
        if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;}
       if(x<0||x>2||y<0||y>n) return;
        System.out.println(count+" "+x+" "+y+" "+map[x][y]);
        result[res]+=map[x][y];
        count++;
        dfs(count,x+1,y);
        dfs(count,x,y+1);
        
         
    }
    public static void main(String[] args) {
        // TODO code application logic here
      //  Scanner sc=new Scanner(System.in);
        for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        }
        System.out.println(map[2][n]);
        //dfs(0,1,1);
//        int max=result[0];
//        for(int i=0;i<res;i++){
//            System.out.println(result[i]);
//            if(max<result[i])
//                max=result[i];
//        }
//        System.out.println(max);
//        
       
     
        


        }
        
    } public class Main {

    /**
     * @param args the command line arguments
     */
    static Scanner sc=new Scanner(System.in);
    static int count=0,res=0; 
    static int n=sc.nextInt();
    static int m=n;
    static int map[][]=new int[3][n+1];
 //   static int book[][]=new int[3][n+1];
    static int result[]=new int[2*n+1];
    public static void dfs(int count,int x,int y){
        if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;}
       if(x<0||x>2||y<0||y>n) return;
        System.out.println(count+" "+x+" "+y+" "+map[x][y]);
        result[res]+=map[x][y];
        count++;
        dfs(count,x+1,y);
        dfs(count,x,y+1);
        
         
    }
    public static void main(String[] args) {
        // TODO code application logic here
      //  Scanner sc=new Scanner(System.in);
        for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        }
        System.out.println(map[2][n]);
        //dfs(0,1,1);
//        int max=result[0];
//        for(int i=0;i<res;i++){
//            System.out.println(result[i]);
//            if(max<result[i])
//                max=result[i];
//        }
//        System.out.println(max);
//        
       
     
        


        }
        
    } Main


import java.util.Scanner;

/**
 *
 * @author Administrator
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    static Scanner sc=new Scanner(System.in);
    static int count=0,res=0; 
    static int n=sc.nextInt();
    static int m=n;
    static int map[][]=new int[3][n+1];
 //   static int book[][]=new int[3][n+1];
    static int result[]=new int[2*n+1];
    public static void dfs(int count,int x,int y){
        if(count==m+1) {
           // if(res==0) m+=1;
            res++;  
            return;}
       if(x<0||x>2||y<0||y>n) return;
        System.out.println(count+" "+x+" "+y+" "+map[x][y]);
        result[res]+=map[x][y];
        count++;
        dfs(count,x+1,y);
        dfs(count,x,y+1);
        
         
    }
    public static void main(String[] args) {
        // TODO code application logic here
      //  Scanner sc=new Scanner(System.in);
        for(int i=1;i<=2;i++){
            for(int j=1;j<=n;j++){
                map[i][j]=sc.nextInt();
                map[i][j]+=Math.max(map[i-1][j],map[i][j-1]);
            }
        }
        System.out.println(map[2][n]);
        //dfs(0,1,1);
//        int max=result[0];
//        for(int i=0;i<res;i++){
//            System.out.println(result[i]);
//            if(max<result[i])
//                max=result[i];
//        }
//        System.out.println(max);
//        
       
     
        


        }
        
    }
    

