import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[][] candy = new int[n][2];
    for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    }
    for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    }
    for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    }
    candy[0][1] += candy[0][0];
    for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    }
    System.out.println(candy[n-1][1]);
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[][] candy = new int[n][2];
    for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    }
    for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    }
    for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    }
    candy[0][1] += candy[0][0];
    for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    }
    System.out.println(candy[n-1][1]);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[][] candy = new int[n][2];
    for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    }
    for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    }
    for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    }
    candy[0][1] += candy[0][0];
    for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    }
    System.out.println(candy[n-1][1]);
  } main {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[][] candy = new int[n][2];
    for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    }
    for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    }
    for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    }
    candy[0][1] += candy[0][0];
    for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    }
    System.out.println(candy[n-1][1]);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int[][] candy = new int[n][2]; candy new int[n][2] n 2 for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      candy[i][0] = Integer.parseInt(sc.next());
    } {
      candy[i][0] = Integer.parseInt(sc.next());
    } candy[i][0] = Integer.parseInt(sc.next()) candy[i][0] candy[i] candy i 0 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      candy[i][1] = Integer.parseInt(sc.next());
    } {
      candy[i][1] = Integer.parseInt(sc.next());
    } candy[i][1] = Integer.parseInt(sc.next()) candy[i][1] candy[i] candy i 1 Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
      candy[i][0] += candy[i-1][0];
    } {
      candy[i][0] += candy[i-1][0];
    } candy[i][0] += candy[i-1][0] candy[i][0] candy[i] candy i 0 candy[i-1][0] candy[i-1] candy i-1 i 1 0 candy[0][1] += candy[0][0] candy[0][1] candy[0] candy 0 1 candy[0][0] candy[0] candy 0 0 for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    } {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    } candy[i][1] += Math.max(candy[i-1][1], candy[i][0]) candy[i][1] candy[i] candy i 1 Math.max(candy[i-1][1], candy[i][0]) Math.max Math candy[i-1][1] candy[i-1] candy i-1 i 1 1 candy[i][0] candy[i] candy i 0 System.out.println(candy[n-1][1]) System.out.println System.out System System.out candy[n-1][1] candy[n-1] candy n-1 n 1 1 String[] args args public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[][] candy = new int[n][2];
    for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    }
    for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    }
    for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    }
    candy[0][1] += candy[0][0];
    for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    }
    System.out.println(candy[n-1][1]);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[][] candy = new int[n][2];
    for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    }
    for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    }
    for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    }
    candy[0][1] += candy[0][0];
    for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    }
    System.out.println(candy[n-1][1]);
  }
} Main
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[][] candy = new int[n][2];
    for(int i = 0; i < n; i++) {
      candy[i][0] = Integer.parseInt(sc.next());
    }
    for(int i = 0; i < n; i++) {
      candy[i][1] = Integer.parseInt(sc.next());
    }
    for(int i = 1; i < n; i++) {
      candy[i][0] += candy[i-1][0];
    }
    candy[0][1] += candy[0][0];
    for(int i = 1; i < n; i++) {
      candy[i][1] += Math.max(candy[i-1][1], candy[i][0]);
    }
    System.out.println(candy[n-1][1]);
  }
}
