import java.util.Scanner;

public class Main {
    static int[] kachi;
    static int[] cost;
    private static int result;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int counter = scanner.nextInt();

        kachi = new int[counter];
        cost = new int[counter];

        int maxKachi = 0;
        for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        }

        int maxCost = 0;
        for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        }
        result = maxKachi - maxCost;

        select(0,counter,0);
        System.out.println(result);

    }

    public static void select(int index, final int counter, int tmp) {
        if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        }

        select(index + 1, counter, tmp);
        select(index + 1, counter, tmp + kachi[index] - cost[index]);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    static int[] kachi;
    static int[] cost;
    private static int result;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int counter = scanner.nextInt();

        kachi = new int[counter];
        cost = new int[counter];

        int maxKachi = 0;
        for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        }

        int maxCost = 0;
        for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        }
        result = maxKachi - maxCost;

        select(0,counter,0);
        System.out.println(result);

    }

    public static void select(int index, final int counter, int tmp) {
        if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        }

        select(index + 1, counter, tmp);
        select(index + 1, counter, tmp + kachi[index] - cost[index]);
    }
} Main static int[] kachi; kachi static int[] cost; cost private static int result; result public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int counter = scanner.nextInt();

        kachi = new int[counter];
        cost = new int[counter];

        int maxKachi = 0;
        for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        }

        int maxCost = 0;
        for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        }
        result = maxKachi - maxCost;

        select(0,counter,0);
        System.out.println(result);

    } main {
        final Scanner scanner = new Scanner(System.in);
        final int counter = scanner.nextInt();

        kachi = new int[counter];
        cost = new int[counter];

        int maxKachi = 0;
        for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        }

        int maxCost = 0;
        for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        }
        result = maxKachi - maxCost;

        select(0,counter,0);
        System.out.println(result);

    } final Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) final int counter = scanner.nextInt(); counter scanner.nextInt() scanner.nextInt scanner kachi = new int[counter] kachi new int[counter] counter cost = new int[counter] cost new int[counter] counter int maxKachi = 0; maxKachi 0 for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        } int i = 0; int i = 0; i 0 i < counter i counter i++ i++ i {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        } {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        } kachi[i] = scanner.nextInt() kachi[i] kachi i scanner.nextInt() scanner.nextInt scanner maxKachi += kachi[i] maxKachi kachi[i] kachi i int maxCost = 0; maxCost 0 for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        } int i = 0; int i = 0; i 0 i < counter i counter i++ i++ i {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        } {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        } cost[i] = scanner.nextInt() cost[i] cost i scanner.nextInt() scanner.nextInt scanner maxCost += cost[i] maxCost cost[i] cost i result = maxKachi - maxCost result maxKachi - maxCost maxKachi maxCost select(0,counter,0) select 0 counter 0 System.out.println(result) System.out.println System.out System System.out result String[] args args public static void select(int index, final int counter, int tmp) {
        if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        }

        select(index + 1, counter, tmp);
        select(index + 1, counter, tmp + kachi[index] - cost[index]);
    } select {
        if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        }

        select(index + 1, counter, tmp);
        select(index + 1, counter, tmp + kachi[index] - cost[index]);
    } if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        } index == counter - 1 index counter - 1 counter 1 {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        } if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            } tmp + kachi[index] - cost[index] > result tmp + kachi[index] - cost[index] tmp + kachi[index] tmp kachi[index] kachi index cost[index] cost index result {
                result = tmp + kachi[index] - cost[index];
            } result = tmp + kachi[index] - cost[index] result tmp + kachi[index] - cost[index] tmp + kachi[index] tmp kachi[index] kachi index cost[index] cost index if (tmp > result) {
                result = tmp;
            } tmp > result tmp result {
                result = tmp;
            } result = tmp result tmp return; select(index + 1, counter, tmp) select index + 1 index 1 counter tmp select(index + 1, counter, tmp + kachi[index] - cost[index]) select index + 1 index 1 counter tmp + kachi[index] - cost[index] tmp + kachi[index] tmp kachi[index] kachi index cost[index] cost index int index index final int counter counter int tmp tmp public class Main {
    static int[] kachi;
    static int[] cost;
    private static int result;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int counter = scanner.nextInt();

        kachi = new int[counter];
        cost = new int[counter];

        int maxKachi = 0;
        for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        }

        int maxCost = 0;
        for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        }
        result = maxKachi - maxCost;

        select(0,counter,0);
        System.out.println(result);

    }

    public static void select(int index, final int counter, int tmp) {
        if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        }

        select(index + 1, counter, tmp);
        select(index + 1, counter, tmp + kachi[index] - cost[index]);
    }
} public class Main {
    static int[] kachi;
    static int[] cost;
    private static int result;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int counter = scanner.nextInt();

        kachi = new int[counter];
        cost = new int[counter];

        int maxKachi = 0;
        for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        }

        int maxCost = 0;
        for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        }
        result = maxKachi - maxCost;

        select(0,counter,0);
        System.out.println(result);

    }

    public static void select(int index, final int counter, int tmp) {
        if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        }

        select(index + 1, counter, tmp);
        select(index + 1, counter, tmp + kachi[index] - cost[index]);
    }
} Main
import java.util.Scanner;

public class Main {
    static int[] kachi;
    static int[] cost;
    private static int result;

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final int counter = scanner.nextInt();

        kachi = new int[counter];
        cost = new int[counter];

        int maxKachi = 0;
        for (int i = 0; i < counter; i++) {
            kachi[i] = scanner.nextInt();
            maxKachi += kachi[i];
        }

        int maxCost = 0;
        for (int i = 0; i < counter; i++) {
            cost[i] = scanner.nextInt();
            maxCost += cost[i];
        }
        result = maxKachi - maxCost;

        select(0,counter,0);
        System.out.println(result);

    }

    public static void select(int index, final int counter, int tmp) {
        if (index == counter - 1) {
            if (tmp + kachi[index] - cost[index] > result) {
                result = tmp + kachi[index] - cost[index];
            }

            if (tmp > result) {
                result = tmp;
            }

            return;
        }

        select(index + 1, counter, tmp);
        select(index + 1, counter, tmp + kachi[index] - cost[index]);
    }
}
