import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        int[] v = new int[n];
        int[] c = new int[n];
        int[] dp = new int[n];


        for (int i = 0; i < n; i++) {
            dp[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        }
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        }

        dp[0] = 0;

        for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        }

        int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]);
        dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1];

        System.out.println(dp[n - 1]);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        int[] v = new int[n];
        int[] c = new int[n];
        int[] dp = new int[n];


        for (int i = 0; i < n; i++) {
            dp[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        }
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        }

        dp[0] = 0;

        for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        }

        int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]);
        dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1];

        System.out.println(dp[n - 1]);
    }
} Main public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        int[] v = new int[n];
        int[] c = new int[n];
        int[] dp = new int[n];


        for (int i = 0; i < n; i++) {
            dp[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        }
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        }

        dp[0] = 0;

        for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        }

        int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]);
        dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1];

        System.out.println(dp[n - 1]);
    } main {
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        int[] v = new int[n];
        int[] c = new int[n];
        int[] dp = new int[n];


        for (int i = 0; i < n; i++) {
            dp[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        }
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        }

        dp[0] = 0;

        for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        }

        int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]);
        dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1];

        System.out.println(dp[n - 1]);
    } Scanner s = new Scanner(System.in); s new Scanner(System.in) int n = Integer.parseInt(s.next()); n Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s int[] v = new int[n]; v new int[n] n int[] c = new int[n]; c new int[n] n int[] dp = new int[n]; dp new int[n] n for (int i = 0; i < n; i++) {
            dp[i] = 0;
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            dp[i] = 0;
        } {
            dp[i] = 0;
        } dp[i] = 0 dp[i] dp i 0 for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            v[i] = Integer.parseInt(s.next());
        } {
            v[i] = Integer.parseInt(s.next());
        } v[i] = Integer.parseInt(s.next()) v[i] v i Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            c[i] = Integer.parseInt(s.next());
        } {
            c[i] = Integer.parseInt(s.next());
        } c[i] = Integer.parseInt(s.next()) c[i] c i Integer.parseInt(s.next()) Integer.parseInt Integer s.next() s.next s dp[0] = 0 dp[0] dp 0 0 for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        } {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        } int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]); tmp dp[i - 1] + (v[i - 1] - c[i - 1]) dp[i - 1] dp i - 1 i 1 (v[i - 1] - c[i - 1]) v[i - 1] v i - 1 i 1 c[i - 1] c i - 1 i 1 dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1] dp[i] dp i tmp > dp[i - 1] ? tmp : dp[i - 1] tmp > dp[i - 1] tmp dp[i - 1] dp i - 1 i 1 tmp dp[i - 1] dp i - 1 i 1 int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]); tmp dp[n - 1] + (v[n - 1] - c[n - 1]) dp[n - 1] dp n - 1 n 1 (v[n - 1] - c[n - 1]) v[n - 1] v n - 1 n 1 c[n - 1] c n - 1 n 1 dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1] dp[n - 1] dp n - 1 n 1 tmp > dp[n - 1] ? tmp : dp[n - 1] tmp > dp[n - 1] tmp dp[n - 1] dp n - 1 n 1 tmp dp[n - 1] dp n - 1 n 1 System.out.println(dp[n - 1]) System.out.println System.out System System.out dp[n - 1] dp n - 1 n 1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        int[] v = new int[n];
        int[] c = new int[n];
        int[] dp = new int[n];


        for (int i = 0; i < n; i++) {
            dp[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        }
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        }

        dp[0] = 0;

        for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        }

        int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]);
        dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1];

        System.out.println(dp[n - 1]);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        int[] v = new int[n];
        int[] c = new int[n];
        int[] dp = new int[n];


        for (int i = 0; i < n; i++) {
            dp[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        }
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        }

        dp[0] = 0;

        for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        }

        int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]);
        dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1];

        System.out.println(dp[n - 1]);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = Integer.parseInt(s.next());
        int[] v = new int[n];
        int[] c = new int[n];
        int[] dp = new int[n];


        for (int i = 0; i < n; i++) {
            dp[i] = 0;
        }
        for (int i = 0; i < n; i++) {
            v[i] = Integer.parseInt(s.next());
        }
        for (int i = 0; i < n; i++) {
            c[i] = Integer.parseInt(s.next());
        }

        dp[0] = 0;

        for (int i = 1; i < n; i++) {
            int tmp = dp[i - 1] + (v[i - 1] - c[i - 1]);
            dp[i] = tmp > dp[i - 1] ? tmp : dp[i - 1];
        }

        int tmp = dp[n - 1] + (v[n - 1] - c[n - 1]);
        dp[n - 1] = tmp > dp[n - 1] ? tmp : dp[n - 1];

        System.out.println(dp[n - 1]);
    }
}