import java.util.*;

public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++) v[i] = scan.nextInt();
        for(int i = 0; i < n; i++) c[i] = scan.nextInt();
        int out = -100;
        for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        }
        System.out.println(out);
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
} import java.util.*; util.* java public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++) v[i] = scan.nextInt();
        for(int i = 0; i < n; i++) c[i] = scan.nextInt();
        int out = -100;
        for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        }
        System.out.println(out);
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
} Main void solve(){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++) v[i] = scan.nextInt();
        for(int i = 0; i < n; i++) c[i] = scan.nextInt();
        int out = -100;
        for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        }
        System.out.println(out);
    } solve {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++) v[i] = scan.nextInt();
        for(int i = 0; i < n; i++) c[i] = scan.nextInt();
        int out = -100;
        for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        }
        System.out.println(out);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan 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] = scan.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i v[i] = scan.nextInt(); v[i] = scan.nextInt() v[i] v i scan.nextInt() scan.nextInt scan for(int i = 0; i < n; i++) c[i] = scan.nextInt(); int i = 0; int i = 0; i 0 i < n i n i++ i++ i c[i] = scan.nextInt(); c[i] = scan.nextInt() c[i] c i scan.nextInt() scan.nextInt scan int out = -100; out -100 100 for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        } int i = 0; int i = 0; i 0 i < 1 << n i 1 << n 1 n i++ i++ i {
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        } {
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        } int x = 0; x 0 int y = 0; y 0 for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            } {
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            } if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                } ((i >> j) & 1) == 1 ((i >> j) & 1) (i >> j) i j 1 1 {
                    x += v[j];
                    y += c[j];
                } x += v[j] x v[j] v j y += c[j] y c[j] c j if(out < x - y) out = x - y; out < x - y out x - y x y out = x - y out x - y x y System.out.println(out) System.out.println System.out System System.out out public static void main(String[] args){
        new Main().solve();
    } main {
        new Main().solve();
    } new Main().solve() new Main().solve new Main() String[] args args public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++) v[i] = scan.nextInt();
        for(int i = 0; i < n; i++) c[i] = scan.nextInt();
        int out = -100;
        for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        }
        System.out.println(out);
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
} public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++) v[i] = scan.nextInt();
        for(int i = 0; i < n; i++) c[i] = scan.nextInt();
        int out = -100;
        for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        }
        System.out.println(out);
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
} Main
import java.util.*;

public class Main{
    void solve(){
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int[] v = new int[n];
        int[] c = new int[n];
        for(int i = 0; i < n; i++) v[i] = scan.nextInt();
        for(int i = 0; i < n; i++) c[i] = scan.nextInt();
        int out = -100;
        for(int i = 0; i < 1 << n; i++){
            int x = 0;
            int y = 0;
            for(int j = 0; j < n; j++){
                if(((i >> j) & 1) == 1){
                    x += v[j];
                    y += c[j];
                }
            }
            if(out < x - y) out = x - y;
        }
        System.out.println(out);
    }
    
    public static void main(String[] args){
        new Main().solve();
    }
}