import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		}
		int ans = 0;
		for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		}
		int ans = 0;
		for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		}
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		}
		int ans = 0;
		for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		}
		System.out.println(ans);
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		}
		int ans = 0;
		for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		}
		System.out.println(ans);
		sc.close();
	} 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[] v = new int[n]; v new int[n] n int[] c = new int[n]; c new int[n] n for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		} int i = 0; int i = 0; i 0 i < v.length i v.length v v.length i++ i++ i {
			v[i] = Integer.parseInt(sc.next());
		} {
			v[i] = Integer.parseInt(sc.next());
		} v[i] = Integer.parseInt(sc.next()) v[i] v i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		} int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
			c[i] = Integer.parseInt(sc.next());
		} {
			c[i] = Integer.parseInt(sc.next());
		} c[i] = Integer.parseInt(sc.next()) c[i] c i Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int ans = 0; ans 0 for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		} int i = 0; int i = 0; i 0 i < (1 << n) i (1 << n) 1 n i++ i++ i {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		} {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		} int sum = 0; sum 0 for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			} {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			} if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				} (i & (1 << j)) != 0 (i & (1 << j)) i (1 << j) 1 j 0 {
					sum += v[j] - c[j];
				} sum += v[j] - c[j] sum v[j] - c[j] v[j] v j c[j] c j ans = Math.max(ans, sum) ans Math.max(ans, sum) Math.max Math ans sum System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		}
		int ans = 0;
		for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		}
		int ans = 0;
		for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		}
		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int[] v = new int[n];
		int[] c = new int[n];
		for (int i = 0; i < v.length; i++) {
			v[i] = Integer.parseInt(sc.next());
		}
		for (int i = 0; i < c.length; i++) {
			c[i] = Integer.parseInt(sc.next());
		}
		int ans = 0;
		for (int i = 0; i < (1 << n); i++) {
			int sum = 0;
			for (int j = 0; j < n; j++) {
				if ((i & (1 << j)) != 0) {
					sum += v[j] - c[j];
				}
			}
			ans = Math.max(ans, sum);
		}
		System.out.println(ans);
		sc.close();
	}
}