import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = Integer.parseInt(scanner.nextLine());
    String[] value = scanner.nextLine().split(" ");
    String[] cost = scanner.nextLine().split(" ");
    
    ArrayList list = new ArrayList<Integer>();
    int tmp = 0;
    for (int i = 0; i < num; i++) {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    }
    if (list.size() == 0) {
      System.out.println("0");
    }
    else {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      }
      System.out.println(sum);
    }
  }
} import java.util.*; util.* java class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = Integer.parseInt(scanner.nextLine());
    String[] value = scanner.nextLine().split(" ");
    String[] cost = scanner.nextLine().split(" ");
    
    ArrayList list = new ArrayList<Integer>();
    int tmp = 0;
    for (int i = 0; i < num; i++) {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    }
    if (list.size() == 0) {
      System.out.println("0");
    }
    else {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      }
      System.out.println(sum);
    }
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = Integer.parseInt(scanner.nextLine());
    String[] value = scanner.nextLine().split(" ");
    String[] cost = scanner.nextLine().split(" ");
    
    ArrayList list = new ArrayList<Integer>();
    int tmp = 0;
    for (int i = 0; i < num; i++) {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    }
    if (list.size() == 0) {
      System.out.println("0");
    }
    else {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      }
      System.out.println(sum);
    }
  } main {
    Scanner scanner = new Scanner(System.in);
    int num = Integer.parseInt(scanner.nextLine());
    String[] value = scanner.nextLine().split(" ");
    String[] cost = scanner.nextLine().split(" ");
    
    ArrayList list = new ArrayList<Integer>();
    int tmp = 0;
    for (int i = 0; i < num; i++) {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    }
    if (list.size() == 0) {
      System.out.println("0");
    }
    else {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      }
      System.out.println(sum);
    }
  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int num = Integer.parseInt(scanner.nextLine()); num Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner String[] value = scanner.nextLine().split(" "); value scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " String[] cost = scanner.nextLine().split(" "); cost scanner.nextLine().split(" ") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner " " ArrayList list = new ArrayList<Integer>(); list new ArrayList<Integer>() int tmp = 0; tmp 0 for (int i = 0; i < num; i++) {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    } {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    } if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      } (tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0 (tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) tmp Integer.parseInt(value[i]) - Integer.parseInt(cost[i]) Integer.parseInt(value[i]) Integer.parseInt Integer value[i] value i Integer.parseInt(cost[i]) Integer.parseInt Integer cost[i] cost i 0 {
        list.add(tmp);
      } list.add(tmp) list.add list tmp if (list.size() == 0) {
      System.out.println("0");
    }
    else {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      }
      System.out.println(sum);
    } list.size() == 0 list.size() list.size list 0 {
      System.out.println("0");
    } System.out.println("0") System.out.println System.out System System.out "0" {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      }
      System.out.println(sum);
    } Collections.sort(list, Comparator.reverseOrder()) Collections.sort Collections list Comparator.reverseOrder() Comparator.reverseOrder Comparator int sum = 0; sum 0 for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      } int i = 0; int i = 0; i 0 i < list.size() i list.size() list.size list i++ i++ i {
        sum += (Integer)list.get(i);
      } {
        sum += (Integer)list.get(i);
      } sum += (Integer)list.get(i) sum (Integer)list.get(i) list.get list i System.out.println(sum) System.out.println System.out System System.out sum String[] args args
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int num = Integer.parseInt(scanner.nextLine());
    String[] value = scanner.nextLine().split(" ");
    String[] cost = scanner.nextLine().split(" ");
    
    ArrayList list = new ArrayList<Integer>();
    int tmp = 0;
    for (int i = 0; i < num; i++) {
      if ((tmp = Integer.parseInt(value[i]) - Integer.parseInt(cost[i])) > 0) {
        list.add(tmp);
      }
    }
    if (list.size() == 0) {
      System.out.println("0");
    }
    else {
      Collections.sort(list, Comparator.reverseOrder());
      int sum = 0;
      for (int i = 0; i < list.size(); i++) {
        sum += (Integer)list.get(i);
      }
      System.out.println(sum);
    }
  }
}