import java.util.*;
import java.io.*;

public class Main
{
  	int n, max = -1000000;
 	int[] v, c;
  
    Main(Scanner in, PrintWriter out)
    {
    	n = in.nextInt();
      	v = new int[n];
      	c = new int[n];
      	for (int i = 0; i < n; i++)
        	v[i] = in.nextInt();
      	for (int i = 0; i < n; i++)
          	c[i] = in.nextInt();
      	for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        }
      	
      	out.println(max);
    }
	
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		new	Main(in, out);
		out.close();
	} 
} import java.util.*; util.* java import java.io.*; io.* java public class Main
{
  	int n, max = -1000000;
 	int[] v, c;
  
    Main(Scanner in, PrintWriter out)
    {
    	n = in.nextInt();
      	v = new int[n];
      	c = new int[n];
      	for (int i = 0; i < n; i++)
        	v[i] = in.nextInt();
      	for (int i = 0; i < n; i++)
          	c[i] = in.nextInt();
      	for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        }
      	
      	out.println(max);
    }
	
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		new	Main(in, out);
		out.close();
	} 
} Main int n n max = -1000000; max -1000000 1000000 int[] v v c; c Main(Scanner in, PrintWriter out)
    {
    	n = in.nextInt();
      	v = new int[n];
      	c = new int[n];
      	for (int i = 0; i < n; i++)
        	v[i] = in.nextInt();
      	for (int i = 0; i < n; i++)
          	c[i] = in.nextInt();
      	for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        }
      	
      	out.println(max);
    } Main {
    	n = in.nextInt();
      	v = new int[n];
      	c = new int[n];
      	for (int i = 0; i < n; i++)
        	v[i] = in.nextInt();
      	for (int i = 0; i < n; i++)
          	c[i] = in.nextInt();
      	for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        }
      	
      	out.println(max);
    } n = in.nextInt() n in.nextInt() in.nextInt in v = new int[n] v new int[n] n c = new int[n] c new int[n] n 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] 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] c i in.nextInt() in.nextInt in for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        } int i = 0; int i = 0; i 0 i < (1 << n) i (1 << n) 1 n i++ i++ i {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        } {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        } int V = 0 V 0 C = 0; C 0 for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                } int j = 0; int j = 0; j 0 j < n j n j++ j++ j if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                } if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                } (i & (1 << j)) > 0 (i & (1 << j)) i (1 << j) 1 j 0 {
                  	V += v[j];
                  	C += c[j];
                } V += v[j] V v[j] v j C += c[j] C c[j] c j max = Math.max(max, V-C) max Math.max(max, V-C) Math.max Math max V-C V C out.println(max) out.println out max Scanner in in PrintWriter out out public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		new	Main(in, out);
		out.close();
	} main {
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		new	Main(in, out);
		out.close();
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) new	Main(in, out) out.close() out.close out String[] args args public class Main
{
  	int n, max = -1000000;
 	int[] v, c;
  
    Main(Scanner in, PrintWriter out)
    {
    	n = in.nextInt();
      	v = new int[n];
      	c = new int[n];
      	for (int i = 0; i < n; i++)
        	v[i] = in.nextInt();
      	for (int i = 0; i < n; i++)
          	c[i] = in.nextInt();
      	for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        }
      	
      	out.println(max);
    }
	
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		new	Main(in, out);
		out.close();
	} 
} public class Main
{
  	int n, max = -1000000;
 	int[] v, c;
  
    Main(Scanner in, PrintWriter out)
    {
    	n = in.nextInt();
      	v = new int[n];
      	c = new int[n];
      	for (int i = 0; i < n; i++)
        	v[i] = in.nextInt();
      	for (int i = 0; i < n; i++)
          	c[i] = in.nextInt();
      	for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        }
      	
      	out.println(max);
    }
	
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		new	Main(in, out);
		out.close();
	} 
} Main
import java.util.*;
import java.io.*;

public class Main
{
  	int n, max = -1000000;
 	int[] v, c;
  
    Main(Scanner in, PrintWriter out)
    {
    	n = in.nextInt();
      	v = new int[n];
      	c = new int[n];
      	for (int i = 0; i < n; i++)
        	v[i] = in.nextInt();
      	for (int i = 0; i < n; i++)
          	c[i] = in.nextInt();
      	for (int i = 0; i < (1 << n); i++)
        {
          	int V = 0, C = 0;
          	for (int j = 0; j < n; j++)
              	if ((i & (1 << j)) > 0)
                {
                  	V += v[j];
                  	C += c[j];
                }
          	max = Math.max(max, V-C);
        }
      	
      	out.println(max);
    }
	
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		new	Main(in, out);
		out.close();
	} 
}