import 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];
    for (int i = 0; i < n; i++) {
      v[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++) {
      c[i] = sc.nextInt();
    }
    
    System.out.println(maxValue(v, c, 0));
    
    //System.out.println(Arrays.toString(v));
    //System.out.println(Arrays.toString(c));
  }
  
  private static int maxValue(int[] v, int[] c, int start) {
    
    if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    }
    
    int value1 = v[start] - c[start];
    int value2 = maxValue(v, c, start + 1);
    int sum = value1 + value2;
    
    return Math.max(sum, value2);
  }
} import java.util.*; util.* java 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];
    for (int i = 0; i < n; i++) {
      v[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++) {
      c[i] = sc.nextInt();
    }
    
    System.out.println(maxValue(v, c, 0));
    
    //System.out.println(Arrays.toString(v));
    //System.out.println(Arrays.toString(c));
  }
  
  private static int maxValue(int[] v, int[] c, int start) {
    
    if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    }
    
    int value1 = v[start] - c[start];
    int value2 = maxValue(v, c, start + 1);
    int sum = value1 + value2;
    
    return Math.max(sum, value2);
  }
} 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];
    for (int i = 0; i < n; i++) {
      v[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++) {
      c[i] = sc.nextInt();
    }
    
    System.out.println(maxValue(v, c, 0));
    
    //System.out.println(Arrays.toString(v));
    //System.out.println(Arrays.toString(c));
  } main {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] v = new int[n];
    int[] c = 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();
    }
    
    System.out.println(maxValue(v, c, 0));
    
    //System.out.println(Arrays.toString(v));
    //System.out.println(Arrays.toString(c));
  } 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 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] = 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] = sc.nextInt() c[i] c i sc.nextInt() sc.nextInt sc System.out.println(maxValue(v, c, 0)) System.out.println System.out System System.out maxValue(v, c, 0) maxValue v c 0 String[] args args private static int maxValue(int[] v, int[] c, int start) {
    
    if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    }
    
    int value1 = v[start] - c[start];
    int value2 = maxValue(v, c, start + 1);
    int sum = value1 + value2;
    
    return Math.max(sum, value2);
  } maxValue {
    
    if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    }
    
    int value1 = v[start] - c[start];
    int value2 = maxValue(v, c, start + 1);
    int sum = value1 + value2;
    
    return Math.max(sum, value2);
  } if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    } start == v.length - 1 start v.length - 1 v.length v v.length 1 {
      return Math.max(v[start] - c[start], 0);
    } return Math.max(v[start] - c[start], 0); Math.max(v[start] - c[start], 0) Math.max Math v[start] - c[start] v[start] v start c[start] c start 0 int value1 = v[start] - c[start]; value1 v[start] - c[start] v[start] v start c[start] c start int value2 = maxValue(v, c, start + 1); value2 maxValue(v, c, start + 1) maxValue v c start + 1 start 1 int sum = value1 + value2; sum value1 + value2 value1 value2 return Math.max(sum, value2); Math.max(sum, value2) Math.max Math sum value2 int[] v v int[] c c int start start 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];
    for (int i = 0; i < n; i++) {
      v[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++) {
      c[i] = sc.nextInt();
    }
    
    System.out.println(maxValue(v, c, 0));
    
    //System.out.println(Arrays.toString(v));
    //System.out.println(Arrays.toString(c));
  }
  
  private static int maxValue(int[] v, int[] c, int start) {
    
    if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    }
    
    int value1 = v[start] - c[start];
    int value2 = maxValue(v, c, start + 1);
    int sum = value1 + value2;
    
    return Math.max(sum, value2);
  }
} 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];
    for (int i = 0; i < n; i++) {
      v[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++) {
      c[i] = sc.nextInt();
    }
    
    System.out.println(maxValue(v, c, 0));
    
    //System.out.println(Arrays.toString(v));
    //System.out.println(Arrays.toString(c));
  }
  
  private static int maxValue(int[] v, int[] c, int start) {
    
    if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    }
    
    int value1 = v[start] - c[start];
    int value2 = maxValue(v, c, start + 1);
    int sum = value1 + value2;
    
    return Math.max(sum, value2);
  }
} Main
import 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];
    for (int i = 0; i < n; i++) {
      v[i] = sc.nextInt();
    }
    for (int i = 0; i < n; i++) {
      c[i] = sc.nextInt();
    }
    
    System.out.println(maxValue(v, c, 0));
    
    //System.out.println(Arrays.toString(v));
    //System.out.println(Arrays.toString(c));
  }
  
  private static int maxValue(int[] v, int[] c, int start) {
    
    if (start == v.length - 1) {
      return Math.max(v[start] - c[start], 0);
    }
    
    int value1 = v[start] - c[start];
    int value2 = maxValue(v, c, start + 1);
    int sum = value1 + value2;
    
    return Math.max(sum, value2);
  }
}