import java.util.Scanner;

public class Main {
  static int ans = 0;
	static int N;
	static int[] V;
	static int[] C;
  public static void main(String[] args) {
	int i;
	Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    V = new int[N];
    C = new int[N];
    for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    }
    for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    }
    Main.keisan(0, 0, 0);
    System.out.println(ans);
  }
  static void keisan(int now, int x, int y) {
	if (now >= N) {
		return;
	}
	int x1 = x + V[now];
	int y1 = y + C[now];
	ans = Math.max(ans, x1-y1);
	ans = Math.max(ans, x-y);
	keisan(now+1, x, y);
	keisan(now+1, x1, y1);
  }
} import java.util.Scanner; Scanner java.util public class Main {
  static int ans = 0;
	static int N;
	static int[] V;
	static int[] C;
  public static void main(String[] args) {
	int i;
	Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    V = new int[N];
    C = new int[N];
    for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    }
    for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    }
    Main.keisan(0, 0, 0);
    System.out.println(ans);
  }
  static void keisan(int now, int x, int y) {
	if (now >= N) {
		return;
	}
	int x1 = x + V[now];
	int y1 = y + C[now];
	ans = Math.max(ans, x1-y1);
	ans = Math.max(ans, x-y);
	keisan(now+1, x, y);
	keisan(now+1, x1, y1);
  }
} Main static int ans = 0; ans 0 static int N; N static int[] V; V static int[] C; C public static void main(String[] args) {
	int i;
	Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    V = new int[N];
    C = new int[N];
    for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    }
    for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    }
    Main.keisan(0, 0, 0);
    System.out.println(ans);
  } main {
	int i;
	Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    V = new int[N];
    C = new int[N];
    for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    }
    for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    }
    Main.keisan(0, 0, 0);
    System.out.println(ans);
  } int i; i Scanner sc = new Scanner(System.in); sc new Scanner(System.in) N = sc.nextInt() N sc.nextInt() sc.nextInt sc V = new int[N] V new int[N] N C = new int[N] C new int[N] N for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    } i = 0; i = 0 i 0 i < N i N i++ i++ i {
    	V[i] = sc.nextInt();
    } {
    	V[i] = sc.nextInt();
    } V[i] = sc.nextInt() V[i] V i sc.nextInt() sc.nextInt sc for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    } i = 0; i = 0 i 0 i < N i N i++ i++ i {
    	C[i] = sc.nextInt();
    } {
    	C[i] = sc.nextInt();
    } C[i] = sc.nextInt() C[i] C i sc.nextInt() sc.nextInt sc Main.keisan(0, 0, 0) Main.keisan Main 0 0 0 System.out.println(ans) System.out.println System.out System System.out ans String[] args args static void keisan(int now, int x, int y) {
	if (now >= N) {
		return;
	}
	int x1 = x + V[now];
	int y1 = y + C[now];
	ans = Math.max(ans, x1-y1);
	ans = Math.max(ans, x-y);
	keisan(now+1, x, y);
	keisan(now+1, x1, y1);
  } keisan {
	if (now >= N) {
		return;
	}
	int x1 = x + V[now];
	int y1 = y + C[now];
	ans = Math.max(ans, x1-y1);
	ans = Math.max(ans, x-y);
	keisan(now+1, x, y);
	keisan(now+1, x1, y1);
  } if (now >= N) {
		return;
	} now >= N now N {
		return;
	} return; int x1 = x + V[now]; x1 x + V[now] x V[now] V now int y1 = y + C[now]; y1 y + C[now] y C[now] C now ans = Math.max(ans, x1-y1) ans Math.max(ans, x1-y1) Math.max Math ans x1-y1 x1 y1 ans = Math.max(ans, x-y) ans Math.max(ans, x-y) Math.max Math ans x-y x y keisan(now+1, x, y) keisan now+1 now 1 x y keisan(now+1, x1, y1) keisan now+1 now 1 x1 y1 int now now int x x int y y public class Main {
  static int ans = 0;
	static int N;
	static int[] V;
	static int[] C;
  public static void main(String[] args) {
	int i;
	Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    V = new int[N];
    C = new int[N];
    for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    }
    for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    }
    Main.keisan(0, 0, 0);
    System.out.println(ans);
  }
  static void keisan(int now, int x, int y) {
	if (now >= N) {
		return;
	}
	int x1 = x + V[now];
	int y1 = y + C[now];
	ans = Math.max(ans, x1-y1);
	ans = Math.max(ans, x-y);
	keisan(now+1, x, y);
	keisan(now+1, x1, y1);
  }
} public class Main {
  static int ans = 0;
	static int N;
	static int[] V;
	static int[] C;
  public static void main(String[] args) {
	int i;
	Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    V = new int[N];
    C = new int[N];
    for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    }
    for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    }
    Main.keisan(0, 0, 0);
    System.out.println(ans);
  }
  static void keisan(int now, int x, int y) {
	if (now >= N) {
		return;
	}
	int x1 = x + V[now];
	int y1 = y + C[now];
	ans = Math.max(ans, x1-y1);
	ans = Math.max(ans, x-y);
	keisan(now+1, x, y);
	keisan(now+1, x1, y1);
  }
} Main
import java.util.Scanner;

public class Main {
  static int ans = 0;
	static int N;
	static int[] V;
	static int[] C;
  public static void main(String[] args) {
	int i;
	Scanner sc = new Scanner(System.in);
    N = sc.nextInt();
    V = new int[N];
    C = new int[N];
    for (i = 0; i < N; i++) {
    	V[i] = sc.nextInt();
    }
    for (i = 0; i < N; i++) {
    	C[i] = sc.nextInt();
    }
    Main.keisan(0, 0, 0);
    System.out.println(ans);
  }
  static void keisan(int now, int x, int y) {
	if (now >= N) {
		return;
	}
	int x1 = x + V[now];
	int y1 = y + C[now];
	ans = Math.max(ans, x1-y1);
	ans = Math.max(ans, x-y);
	keisan(now+1, x, y);
	keisan(now+1, x1, y1);
  }
}