import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int [] v = new int[n]; //宝石の価値
		int [] c = new int[n]; //宝石のコスト
		
		for(int i = 0; i < n; i++) {
			v[i] = stdIn.nextInt();
		}
		for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		}

		int max = Integer.MIN_VALUE;
		
		for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		}
		
		System.out.println(max);
		
	}

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int [] v = new int[n]; //宝石の価値
		int [] c = new int[n]; //宝石のコスト
		
		for(int i = 0; i < n; i++) {
			v[i] = stdIn.nextInt();
		}
		for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		}

		int max = Integer.MIN_VALUE;
		
		for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		}
		
		System.out.println(max);
		
	}

} Main public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int [] v = new int[n]; //宝石の価値
		int [] c = new int[n]; //宝石のコスト
		
		for(int i = 0; i < n; i++) {
			v[i] = stdIn.nextInt();
		}
		for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		}

		int max = Integer.MIN_VALUE;
		
		for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		}
		
		System.out.println(max);
		
	} main {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int [] v = new int[n]; //宝石の価値
		int [] c = new int[n]; //宝石のコスト
		
		for(int i = 0; i < n; i++) {
			v[i] = stdIn.nextInt();
		}
		for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		}

		int max = Integer.MIN_VALUE;
		
		for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		}
		
		System.out.println(max);
		
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) int n = stdIn.nextInt(); n stdIn.nextInt() stdIn.nextInt stdIn 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 < n; i++) {
			v[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			v[i] = stdIn.nextInt();
		} {
			v[i] = stdIn.nextInt();
		} v[i] = stdIn.nextInt() v[i] v i stdIn.nextInt() stdIn.nextInt stdIn for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {			
			c[i] = stdIn.nextInt();
		} {			
			c[i] = stdIn.nextInt();
		} c[i] = stdIn.nextInt() c[i] c i stdIn.nextInt() stdIn.nextInt stdIn int max = Integer.MIN_VALUE; max Integer.MIN_VALUE Integer Integer.MIN_VALUE for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		} int bit = 0; int bit = 0; bit 0 bit < (1 << n) bit (1 << n) 1 n bit++ bit++ bit {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		} {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		} int sum = 0; sum 0 for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			} {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			} if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				} ((bit >> i) & 1) ==1 ((bit >> i) & 1) (bit >> i) bit i 1 1 {
					sum+= v[i]-c[i];
				} sum+= v[i]-c[i] sum v[i]-c[i] v[i] v i c[i] c i max = Math.max(sum, max) max Math.max(sum, max) Math.max Math sum max System.out.println(max) System.out.println System.out System System.out max String[] args args public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int [] v = new int[n]; //宝石の価値
		int [] c = new int[n]; //宝石のコスト
		
		for(int i = 0; i < n; i++) {
			v[i] = stdIn.nextInt();
		}
		for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		}

		int max = Integer.MIN_VALUE;
		
		for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		}
		
		System.out.println(max);
		
	}

} public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int [] v = new int[n]; //宝石の価値
		int [] c = new int[n]; //宝石のコスト
		
		for(int i = 0; i < n; i++) {
			v[i] = stdIn.nextInt();
		}
		for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		}

		int max = Integer.MIN_VALUE;
		
		for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		}
		
		System.out.println(max);
		
	}

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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int [] v = new int[n]; //宝石の価値
		int [] c = new int[n]; //宝石のコスト
		
		for(int i = 0; i < n; i++) {
			v[i] = stdIn.nextInt();
		}
		for(int i = 0; i < n; i++) {			
			c[i] = stdIn.nextInt();
		}

		int max = Integer.MIN_VALUE;
		
		for(int bit = 0; bit < (1 << n); bit++) {
			int sum = 0;
			
			for(int i = 0; i < n; i++) {
				if(((bit >> i) & 1) ==1) {
					sum+= v[i]-c[i];
				}
			}
			
			max = Math.max(sum, max);
			
		}
		
		System.out.println(max);
		
	}

}
