import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 

		int N = keyboard.nextInt();
		
		int[] X = new int[N];
			for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			}
		int[] Y = new int[N];
			for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			}
			
		int[] sagaku = new int[N];
		for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		}
		
		int Max = 0;
		
		for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		}

		System.out.print(Max);
		keyboard.close();	
	}
} import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 

		int N = keyboard.nextInt();
		
		int[] X = new int[N];
			for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			}
		int[] Y = new int[N];
			for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			}
			
		int[] sagaku = new int[N];
		for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		}
		
		int Max = 0;
		
		for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		}

		System.out.print(Max);
		keyboard.close();	
	}
} Main public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 

		int N = keyboard.nextInt();
		
		int[] X = new int[N];
			for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			}
		int[] Y = new int[N];
			for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			}
			
		int[] sagaku = new int[N];
		for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		}
		
		int Max = 0;
		
		for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		}

		System.out.print(Max);
		keyboard.close();	
	} main {
		
		Scanner keyboard = new Scanner(System.in); 

		int N = keyboard.nextInt();
		
		int[] X = new int[N];
			for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			}
		int[] Y = new int[N];
			for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			}
			
		int[] sagaku = new int[N];
		for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		}
		
		int Max = 0;
		
		for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		}

		System.out.print(Max);
		keyboard.close();	
	} Scanner keyboard = new Scanner(System.in); keyboard new Scanner(System.in) int N = keyboard.nextInt(); N keyboard.nextInt() keyboard.nextInt keyboard int[] X = new int[N]; X new int[N] N for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			} int i=0; int i=0; i 0 i < N i N i++ i++ i {
				X[i] = keyboard.nextInt();
			} {
				X[i] = keyboard.nextInt();
			} X[i] = keyboard.nextInt() X[i] X i keyboard.nextInt() keyboard.nextInt keyboard int[] Y = new int[N]; Y new int[N] N for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			} int j=0; int j=0; j 0 j < N j N j++ j++ j {
				Y[j] = keyboard.nextInt();
			} {
				Y[j] = keyboard.nextInt();
			} Y[j] = keyboard.nextInt() Y[j] Y j keyboard.nextInt() keyboard.nextInt keyboard int[] sagaku = new int[N]; sagaku new int[N] N for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		} int k=0; int k=0; k 0 k < N k N k++ k++ k {
			sagaku[k] = X[k] - Y[k];
		} {
			sagaku[k] = X[k] - Y[k];
		} sagaku[k] = X[k] - Y[k] sagaku[k] sagaku k X[k] - Y[k] X[k] X k Y[k] Y k int Max = 0; Max 0 for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		} int l=0; int l=0; l 0 l < N l N l++ l++ l {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		} {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		} if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				} sagaku[l] + Max > Max sagaku[l] + Max sagaku[l] sagaku l Max Max {
				Max += sagaku[l];
				} Max += sagaku[l] Max sagaku[l] sagaku l System.out.print(Max) System.out.print System.out System System.out Max keyboard.close() keyboard.close keyboard String[] args args public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 

		int N = keyboard.nextInt();
		
		int[] X = new int[N];
			for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			}
		int[] Y = new int[N];
			for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			}
			
		int[] sagaku = new int[N];
		for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		}
		
		int Max = 0;
		
		for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		}

		System.out.print(Max);
		keyboard.close();	
	}
} public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 

		int N = keyboard.nextInt();
		
		int[] X = new int[N];
			for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			}
		int[] Y = new int[N];
			for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			}
			
		int[] sagaku = new int[N];
		for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		}
		
		int Max = 0;
		
		for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		}

		System.out.print(Max);
		keyboard.close();	
	}
} Main
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 

		int N = keyboard.nextInt();
		
		int[] X = new int[N];
			for(int i=0; i < N; i++) {
				X[i] = keyboard.nextInt();
			}
		int[] Y = new int[N];
			for(int j=0; j < N; j++) {
				Y[j] = keyboard.nextInt();
			}
			
		int[] sagaku = new int[N];
		for(int k=0; k < N; k++) {
			sagaku[k] = X[k] - Y[k];
		}
		
		int Max = 0;
		
		for(int l=0; l < N; l++) {	
			if(sagaku[l] + Max > Max) {
				Max += sagaku[l];
				}
		}

		System.out.print(Max);
		keyboard.close();	
	}
}
