import java.util.Arrays;
import java.util.Scanner;

public class Main{

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        int[] d = 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();
        for(int i = 0; i < n; i++) d[i] = v[i] - c[i];
        Arrays.sort(d);
        int ans = 0;
        for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        }
        System.out.print(ans);
    }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        int[] d = 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();
        for(int i = 0; i < n; i++) d[i] = v[i] - c[i];
        Arrays.sort(d);
        int ans = 0;
        for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        }
        System.out.print(ans);
    }
} Main public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        int[] d = 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();
        for(int i = 0; i < n; i++) d[i] = v[i] - c[i];
        Arrays.sort(d);
        int ans = 0;
        for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        }
        System.out.print(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        int[] d = 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();
        for(int i = 0; i < n; i++) d[i] = v[i] - c[i];
        Arrays.sort(d);
        int ans = 0;
        for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        }
        System.out.print(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int[] v = new int[n]; v new int[n] n int[] c = new int[n]; c new int[n] n int[] d = new int[n]; d 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] 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] c i sc.nextInt() sc.nextInt sc for(int i = 0; i < n; i++) d[i] = v[i] - c[i]; int i = 0; int i = 0; i 0 i < n i n i++ i++ i d[i] = v[i] - c[i]; d[i] = v[i] - c[i] d[i] d i v[i] - c[i] v[i] v i c[i] c i Arrays.sort(d) Arrays.sort Arrays d int ans = 0; ans 0 for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        } int i = n - 1; int i = n - 1; i n - 1 n 1 i >= 0 i 0 i-- i-- i {
            if(d[i] >= 0) ans += d[i];
        } {
            if(d[i] >= 0) ans += d[i];
        } if(d[i] >= 0) ans += d[i]; d[i] >= 0 d[i] d i 0 ans += d[i] ans d[i] d i System.out.print(ans) System.out.print System.out System System.out ans String args[] args public class Main{

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        int[] d = 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();
        for(int i = 0; i < n; i++) d[i] = v[i] - c[i];
        Arrays.sort(d);
        int ans = 0;
        for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        }
        System.out.print(ans);
    }
} public class Main{

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        int[] d = 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();
        for(int i = 0; i < n; i++) d[i] = v[i] - c[i];
        Arrays.sort(d);
        int ans = 0;
        for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        }
        System.out.print(ans);
    }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main{

    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        int[] d = 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();
        for(int i = 0; i < n; i++) d[i] = v[i] - c[i];
        Arrays.sort(d);
        int ans = 0;
        for(int i = n - 1; i >= 0; i--){
            if(d[i] >= 0) ans += d[i];
        }
        System.out.print(ans);
    }
}
