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

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] v = new int[N];
    for (int i = 0; i < N; i++) v[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt();
    Arrays.sort(v);
    int vmax = 0;
    for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    }
    System.out.println(vmax);
  }
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] v = new int[N];
    for (int i = 0; i < N; i++) v[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt();
    Arrays.sort(v);
    int vmax = 0;
    for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    }
    System.out.println(vmax);
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] v = new int[N];
    for (int i = 0; i < N; i++) v[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt();
    Arrays.sort(v);
    int vmax = 0;
    for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    }
    System.out.println(vmax);
  } main {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] v = new int[N];
    for (int i = 0; i < N; i++) v[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt();
    Arrays.sort(v);
    int vmax = 0;
    for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    }
    System.out.println(vmax);
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int[] v = new int[N]; v new int[N] N for (int i = 0; i < N; i++) v[i] = scanner.nextInt(); int i = 0; int i = 0; i 0 i < N i N i++ i++ i v[i] = scanner.nextInt(); v[i] = scanner.nextInt() v[i] v i scanner.nextInt() scanner.nextInt scanner for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt(); int i = 0; int i = 0; i 0 i < N i N i++ i++ i v[i] = v[i] - scanner.nextInt(); v[i] = v[i] - scanner.nextInt() v[i] v i v[i] - scanner.nextInt() v[i] v i scanner.nextInt() scanner.nextInt scanner Arrays.sort(v) Arrays.sort Arrays v int vmax = 0; vmax 0 for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    } int i = N - 1; int i = N - 1; i N - 1 N 1 i >= 0 i 0 i-- i-- i {
      if (v[i] > 0) vmax += v[i];
      else break;
    } {
      if (v[i] > 0) vmax += v[i];
      else break;
    } if (v[i] > 0) vmax += v[i];
      else break; v[i] > 0 v[i] v i 0 vmax += v[i] vmax v[i] v i break; System.out.println(vmax) System.out.println System.out System System.out vmax String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] v = new int[N];
    for (int i = 0; i < N; i++) v[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt();
    Arrays.sort(v);
    int vmax = 0;
    for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    }
    System.out.println(vmax);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] v = new int[N];
    for (int i = 0; i < N; i++) v[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt();
    Arrays.sort(v);
    int vmax = 0;
    for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    }
    System.out.println(vmax);
  }
} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int N = scanner.nextInt();
    int[] v = new int[N];
    for (int i = 0; i < N; i++) v[i] = scanner.nextInt();
    for (int i = 0; i < N; i++) v[i] = v[i] - scanner.nextInt();
    Arrays.sort(v);
    int vmax = 0;
    for (int i = N - 1; i >= 0; i--) {
      if (v[i] > 0) vmax += v[i];
      else break;
    }
    System.out.println(vmax);
  }
}
