

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		used = new boolean[n];
		v = new int[n];
		c = new int[n];

		for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		}

		for(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		}

		System.out.println(dfs(0, n));

	}

	static boolean used[];
	static int v[];
	static int c[];

	static int dfs(int depth, int n){
		if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		}

		int result = Integer.MIN_VALUE;;
		used[depth] = false;
		result = Math.max(result, dfs(depth + 1, n));
		used[depth] = true;
		result = Math.max(result, dfs(depth + 1, n));

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

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		used = new boolean[n];
		v = new int[n];
		c = new int[n];

		for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		}

		for(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		}

		System.out.println(dfs(0, n));

	}

	static boolean used[];
	static int v[];
	static int c[];

	static int dfs(int depth, int n){
		if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		}

		int result = Integer.MIN_VALUE;;
		used[depth] = false;
		result = Math.max(result, dfs(depth + 1, n));
		used[depth] = true;
		result = Math.max(result, dfs(depth + 1, n));

		return result;
	}
} Main static boolean used[]; used static int v[]; v static int c[]; c public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		used = new boolean[n];
		v = new int[n];
		c = new int[n];

		for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		}

		for(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		}

		System.out.println(dfs(0, n));

	} main {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		used = new boolean[n];
		v = new int[n];
		c = new int[n];

		for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		}

		for(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		}

		System.out.println(dfs(0, n));

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc used = new boolean[n] used new boolean[n] n v = new int[n] v new int[n] n c = new int[n] c new int[n] n for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		} int i = 0; int 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(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		} int i = 0; int 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 System.out.println(dfs(0, n)) System.out.println System.out System System.out dfs(0, n) dfs 0 n String[] args args static int dfs(int depth, int n){
		if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		}

		int result = Integer.MIN_VALUE;;
		used[depth] = false;
		result = Math.max(result, dfs(depth + 1, n));
		used[depth] = true;
		result = Math.max(result, dfs(depth + 1, n));

		return result;
	} dfs {
		if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		}

		int result = Integer.MIN_VALUE;;
		used[depth] = false;
		result = Math.max(result, dfs(depth + 1, n));
		used[depth] = true;
		result = Math.max(result, dfs(depth + 1, n));

		return result;
	} if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		} depth == n depth n {
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		} int result = 0; result 0 for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				if(used[i]){
					result += v[i] - c[i];
				}
			} {
				if(used[i]){
					result += v[i] - c[i];
				}
			} if(used[i]){
					result += v[i] - c[i];
				} used[i] used i {
					result += v[i] - c[i];
				} result += v[i] - c[i] result v[i] - c[i] v[i] v i c[i] c i return result; result int result = Integer.MIN_VALUE; result Integer.MIN_VALUE Integer Integer.MIN_VALUE used[depth] = false used[depth] used depth false result = Math.max(result, dfs(depth + 1, n)) result Math.max(result, dfs(depth + 1, n)) Math.max Math result dfs(depth + 1, n) dfs depth + 1 depth 1 n used[depth] = true used[depth] used depth true result = Math.max(result, dfs(depth + 1, n)) result Math.max(result, dfs(depth + 1, n)) Math.max Math result dfs(depth + 1, n) dfs depth + 1 depth 1 n return result; result int depth depth int n n public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		used = new boolean[n];
		v = new int[n];
		c = new int[n];

		for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		}

		for(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		}

		System.out.println(dfs(0, n));

	}

	static boolean used[];
	static int v[];
	static int c[];

	static int dfs(int depth, int n){
		if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		}

		int result = Integer.MIN_VALUE;;
		used[depth] = false;
		result = Math.max(result, dfs(depth + 1, n));
		used[depth] = true;
		result = Math.max(result, dfs(depth + 1, n));

		return result;
	}
} public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		used = new boolean[n];
		v = new int[n];
		c = new int[n];

		for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		}

		for(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		}

		System.out.println(dfs(0, n));

	}

	static boolean used[];
	static int v[];
	static int c[];

	static int dfs(int depth, int n){
		if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		}

		int result = Integer.MIN_VALUE;;
		used[depth] = false;
		result = Math.max(result, dfs(depth + 1, n));
		used[depth] = true;
		result = Math.max(result, dfs(depth + 1, n));

		return result;
	}
} Main


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		used = new boolean[n];
		v = new int[n];
		c = new int[n];

		for(int i = 0; i < n; i++){
			v[i] = sc.nextInt();
		}

		for(int i = 0; i < n; i++){
			c[i] = sc.nextInt();
		}

		System.out.println(dfs(0, n));

	}

	static boolean used[];
	static int v[];
	static int c[];

	static int dfs(int depth, int n){
		if(depth == n){
			int result = 0;
			for(int i = 0; i < n; i++){
				if(used[i]){
					result += v[i] - c[i];
				}
			}

			return result;
		}

		int result = Integer.MIN_VALUE;;
		used[depth] = false;
		result = Math.max(result, dfs(depth + 1, n));
		used[depth] = true;
		result = Math.max(result, dfs(depth + 1, n));

		return result;
	}
}
