import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		Integer vlist[] = new Integer[n];
		Integer clist[] = new Integer[n];

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

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

		int max = 0;

		Integer sumlist[] = new Integer[n];

		for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		}
		Arrays.sort(sumlist,Collections.reverseOrder());
		for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		}
		System.out.println(max);
		
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		Integer vlist[] = new Integer[n];
		Integer clist[] = new Integer[n];

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

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

		int max = 0;

		Integer sumlist[] = new Integer[n];

		for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		}
		Arrays.sort(sumlist,Collections.reverseOrder());
		for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		}
		System.out.println(max);
		
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		Integer vlist[] = new Integer[n];
		Integer clist[] = new Integer[n];

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

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

		int max = 0;

		Integer sumlist[] = new Integer[n];

		for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		}
		Arrays.sort(sumlist,Collections.reverseOrder());
		for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		}
		System.out.println(max);
		
	} main {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		Integer vlist[] = new Integer[n];
		Integer clist[] = new Integer[n];

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

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

		int max = 0;

		Integer sumlist[] = new Integer[n];

		for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		}
		Arrays.sort(sumlist,Collections.reverseOrder());
		for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		}
		System.out.println(max);
		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc Integer vlist[] = new Integer[n]; vlist new Integer[n] n Integer clist[] = new Integer[n]; clist new Integer[n] n for(int i=0; i<n; i++){
			vlist[i] = sc.nextInt();
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			vlist[i] = sc.nextInt();
		} {
			vlist[i] = sc.nextInt();
		} vlist[i] = sc.nextInt() vlist[i] vlist i sc.nextInt() sc.nextInt sc for(int j=0; j<n; j++){
			clist[j] = sc.nextInt();
		} int j=0; int j=0; j 0 j<n j n j++ j++ j {
			clist[j] = sc.nextInt();
		} {
			clist[j] = sc.nextInt();
		} clist[j] = sc.nextInt() clist[j] clist j sc.nextInt() sc.nextInt sc int max = 0; max 0 Integer sumlist[] = new Integer[n]; sumlist new Integer[n] n for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		} int s=0; int s=0; s 0 s<n s n s++ s++ s {
			sumlist[s] = vlist[s] - clist[s];
		} {
			sumlist[s] = vlist[s] - clist[s];
		} sumlist[s] = vlist[s] - clist[s] sumlist[s] sumlist s vlist[s] - clist[s] vlist[s] vlist s clist[s] clist s Arrays.sort(sumlist,Collections.reverseOrder()) Arrays.sort Arrays sumlist Collections.reverseOrder() Collections.reverseOrder Collections for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		} int t=0; int t=0; t 0 t<n t n t++ t++ t {
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		} {
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		} if(max + sumlist[t] > max){
				max += sumlist[t];
			} max + sumlist[t] > max max + sumlist[t] max sumlist[t] sumlist t max {
				max += sumlist[t];
			} max += sumlist[t] max sumlist[t] sumlist t 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 sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		Integer vlist[] = new Integer[n];
		Integer clist[] = new Integer[n];

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

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

		int max = 0;

		Integer sumlist[] = new Integer[n];

		for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		}
		Arrays.sort(sumlist,Collections.reverseOrder());
		for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		}
		System.out.println(max);
		
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		Integer vlist[] = new Integer[n];
		Integer clist[] = new Integer[n];

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

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

		int max = 0;

		Integer sumlist[] = new Integer[n];

		for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		}
		Arrays.sort(sumlist,Collections.reverseOrder());
		for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		}
		System.out.println(max);
		
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		
		Integer vlist[] = new Integer[n];
		Integer clist[] = new Integer[n];

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

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

		int max = 0;

		Integer sumlist[] = new Integer[n];

		for(int s=0; s<n; s++){
			sumlist[s] = vlist[s] - clist[s];
		}
		Arrays.sort(sumlist,Collections.reverseOrder());
		for(int t=0; t<n; t++){
			if(max + sumlist[t] > max){
				max += sumlist[t];
			}
		}
		System.out.println(max);
		
	}
}
