import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {

	static FastReaderR in = new FastReaderR(System.in) ;
	
	static int N,index ;
	
	static int V[] = new int[21] , C[] = new int[21] ; 
	
	static int mmax = Integer.MIN_VALUE ;
	
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		N = in.nextInt() ;
		for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		}
		for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		}
		f(N-1,0) ;
		System.out.println(mmax);
	}
	
	public static void f(int dp,int now){
		if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		}
	}

}
class FastReaderR {
    byte[] buf = new byte[2048];
    int index, total;
    InputStream in;
 
    FastReaderR(InputStream is) {
        in = is;
    }
    int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    }
    int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan());
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
    String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan());
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }
} import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.util.*; util.* java public class Main {

	static FastReaderR in = new FastReaderR(System.in) ;
	
	static int N,index ;
	
	static int V[] = new int[21] , C[] = new int[21] ; 
	
	static int mmax = Integer.MIN_VALUE ;
	
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		N = in.nextInt() ;
		for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		}
		for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		}
		f(N-1,0) ;
		System.out.println(mmax);
	}
	
	public static void f(int dp,int now){
		if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		}
	}

} Main static FastReaderR in = new FastReaderR(System.in) ; in new FastReaderR(System.in) static int N N index ; index static int V[] = new int[21] V new int[21] 21 C[] = new int[21] ; C new int[21] 21 static int mmax = Integer.MIN_VALUE ; mmax Integer.MIN_VALUE Integer Integer.MIN_VALUE public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		N = in.nextInt() ;
		for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		}
		for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		}
		f(N-1,0) ;
		System.out.println(mmax);
	} main {
		// TODO Auto-generated method stub
		N = in.nextInt() ;
		for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		}
		for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		}
		f(N-1,0) ;
		System.out.println(mmax);
	} N = in.nextInt() N in.nextInt() in.nextInt in for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			V[i] = in.nextInt() ;
		} {
			V[i] = in.nextInt() ;
		} V[i] = in.nextInt() V[i] V i in.nextInt() in.nextInt in for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			C[i] = in.nextInt() ;
		} {
			C[i] = in.nextInt() ;
		} C[i] = in.nextInt() C[i] C i in.nextInt() in.nextInt in f(N-1,0) f N-1 N 1 0 System.out.println(mmax) System.out.println System.out System System.out mmax String[] args args public static void f(int dp,int now){
		if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		}
	} f {
		if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		}
	} if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		} dp==-1 dp -1 1 {
			if(now>mmax){
				mmax = now ;
			}
		} if(now>mmax){
				mmax = now ;
			} now>mmax now mmax {
				mmax = now ;
			} mmax = now mmax now {
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		} f(dp-1,now+(V[dp]-C[dp])) f dp-1 dp 1 now+(V[dp]-C[dp]) now (V[dp]-C[dp]) V[dp] V dp C[dp] C dp f(dp-1,now) f dp-1 dp 1 now int dp dp int now now class FastReaderR {
    byte[] buf = new byte[2048];
    int index, total;
    InputStream in;
 
    FastReaderR(InputStream is) {
        in = is;
    }
    int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    }
    int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan());
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
    String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan());
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }
} FastReaderR byte[] buf = new byte[2048]; buf new byte[2048] 2048 int index index total; total InputStream in; in FastReaderR(InputStream is) {
        in = is;
    } FastReaderR {
        in = is;
    } in = is in is InputStream is is int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    } scan {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    } if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        } index >= total index total {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        } index = 0 index 0 total = in.read(buf) total in.read(buf) in.read in buf if (total <= 0) {
                return -1;
            } total <= 0 total 0 {
                return -1;
            } return -1; -1 1 return buf[index++]; buf[index++] buf index++ index int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan());
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    } nextInt {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan());
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    } int c c val = 0; val 0 for (c = scan(); c <= 32; c = scan()); c = scan(); c = scan() c scan() scan c <= 32 c 32 c = scan() c = scan() c scan() scan ; boolean neg = c == '-'; neg c == '-' c '-' if (c == '-' || c == '+') {
            c = scan();
        } c == '-' || c == '+' c == '-' c '-' c == '+' c '+' {
            c = scan();
        } c = scan() c scan() scan for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        } ; c >= '0' && c <= '9' c >= '0' c '0' c <= '9' c '9' c = scan() c = scan() c scan() scan {
            val = (val << 3) + (val << 1) + (c & 15);
        } {
            val = (val << 3) + (val << 1) + (c & 15);
        } val = (val << 3) + (val << 1) + (c & 15) val (val << 3) + (val << 1) + (c & 15) (val << 3) + (val << 1) + (c & 15) (val << 3) val 3 (val << 1) val 1 (c & 15) c 15 return neg ? -val : val; neg ? -val : val neg -val val val String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan());
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    } next {
        int c;
        for (c = scan(); c <= 32; c = scan());
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    } int c; c for (c = scan(); c <= 32; c = scan()); c = scan(); c = scan() c scan() scan c <= 32 c 32 c = scan() c = scan() c scan() scan ; StringBuilder sb = new StringBuilder(); sb new StringBuilder() for (; c > 32; c = scan()) {
            sb.append((char) c);
        } ; c > 32 c 32 c = scan() c = scan() c scan() scan {
            sb.append((char) c);
        } {
            sb.append((char) c);
        } sb.append((char) c) sb.append sb (char) c return sb.toString(); sb.toString() sb.toString sb public class Main {

	static FastReaderR in = new FastReaderR(System.in) ;
	
	static int N,index ;
	
	static int V[] = new int[21] , C[] = new int[21] ; 
	
	static int mmax = Integer.MIN_VALUE ;
	
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		N = in.nextInt() ;
		for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		}
		for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		}
		f(N-1,0) ;
		System.out.println(mmax);
	}
	
	public static void f(int dp,int now){
		if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		}
	}

} public class Main {

	static FastReaderR in = new FastReaderR(System.in) ;
	
	static int N,index ;
	
	static int V[] = new int[21] , C[] = new int[21] ; 
	
	static int mmax = Integer.MIN_VALUE ;
	
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		N = in.nextInt() ;
		for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		}
		for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		}
		f(N-1,0) ;
		System.out.println(mmax);
	}
	
	public static void f(int dp,int now){
		if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		}
	}

} Main
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {

	static FastReaderR in = new FastReaderR(System.in) ;
	
	static int N,index ;
	
	static int V[] = new int[21] , C[] = new int[21] ; 
	
	static int mmax = Integer.MIN_VALUE ;
	
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		N = in.nextInt() ;
		for(int i=0;i<N;i++){
			V[i] = in.nextInt() ;
		}
		for(int i=0;i<N;i++){
			C[i] = in.nextInt() ;
		}
		f(N-1,0) ;
		System.out.println(mmax);
	}
	
	public static void f(int dp,int now){
		if(dp==-1){
			if(now>mmax){
				mmax = now ;
			}
		}else{
			f(dp-1,now+(V[dp]-C[dp])) ;
			f(dp-1,now) ; 
		}
	}

}
class FastReaderR {
    byte[] buf = new byte[2048];
    int index, total;
    InputStream in;
 
    FastReaderR(InputStream is) {
        in = is;
    }
    int scan() throws IOException {
        if (index >= total) {
            index = 0;
            total = in.read(buf);
            if (total <= 0) {
                return -1;
            }
        }
        return buf[index++];
    }
    int nextInt() throws IOException {
        int c, val = 0;
        for (c = scan(); c <= 32; c = scan());
        boolean neg = c == '-';
        if (c == '-' || c == '+') {
            c = scan();
        }
        for (; c >= '0' && c <= '9'; c = scan()) {
            val = (val << 3) + (val << 1) + (c & 15);
        }
        return neg ? -val : val;
    }
    String next() throws IOException {
        int c;
        for (c = scan(); c <= 32; c = scan());
        StringBuilder sb = new StringBuilder();
        for (; c > 32; c = scan()) {
            sb.append((char) c);
        }
        return sb.toString();
    }
}