

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

public class Main {
    // https://atcoder.jp/contests/abc135/tasks/abc135_c
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextLine() throws IOException {
            return reader.readLine().trim();
        }
    }
} import java.io.*; io.* java import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    // https://atcoder.jp/contests/abc135/tasks/abc135_c
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextLine() throws IOException {
            return reader.readLine().trim();
        }
    }
} Main // https://atcoder.jp/contests/abc135/tasks/abc135_c
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    } InputStream inputStream = System.in; inputStream System.in System System.in OutputStream outputStream = System.out; outputStream System.out System System.out InputReader in = new InputReader(inputStream); in new InputReader(inputStream) PrintWriter out = new PrintWriter(outputStream); out new PrintWriter(outputStream) Task solver = new Task(); solver new Task() solver.solve(1, in, out) solver.solve solver 1 in out out.close() out.close out String[] args args static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        }
    } Task public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        } solve {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        } int n = in.nextInt(); n in.nextInt() in.nextInt in long[] towns = new long[n+1]; towns new long[n+1] n+1 n 1 long[] heroes = new long[n]; heroes new long[n] n for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            } int i = 0; int i = 0; i 0 i < n+1 i n+1 n 1 i++ i++ i {
                towns[i] = in.nextLong();
            } {
                towns[i] = in.nextLong();
            } towns[i] = in.nextLong() towns[i] towns i in.nextLong() in.nextLong in for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
                heroes[i] = in.nextLong();
            } {
                heroes[i] = in.nextLong();
            } heroes[i] = in.nextLong() heroes[i] heroes i in.nextLong() in.nextLong in long count = 0; count 0 for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            } int i = n-1; int i = n-1; i n-1 n 1 i >= 0 i 0 i-- i-- i {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            } {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            } if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                } towns[i+1] < heroes[i] towns[i+1] towns i+1 i 1 heroes[i] heroes i {
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                } count += towns[i+1] count towns[i+1] towns i+1 i 1 heroes[i] -= towns[i+1] heroes[i] heroes i towns[i+1] towns i+1 i 1 count += Math.min(towns[i], heroes[i]) count Math.min(towns[i], heroes[i]) Math.min Math towns[i] towns i heroes[i] heroes i towns[i] -= Math.min(towns[i], heroes[i]) towns[i] towns i Math.min(towns[i], heroes[i]) Math.min Math towns[i] towns i heroes[i] heroes i {
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                } count+= heroes[i] count heroes[i] heroes i towns[i+1] -= heroes[i] towns[i+1] towns i+1 i 1 heroes[i] heroes i out.println(count) out.println out count int testNumber testNumber InputReader in in PrintWriter out out static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextLine() throws IOException {
            return reader.readLine().trim();
        }
    } InputReader public BufferedReader reader; reader public StringTokenizer tokenizer; tokenizer public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } InputReader {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        } reader = new BufferedReader(new InputStreamReader(stream), 32768) reader new BufferedReader(new InputStreamReader(stream), 32768) tokenizer = null tokenizer null InputStream stream stream public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } next {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            } try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } IOException e {
                    throw new RuntimeException(e);
                } throw new RuntimeException(e); new RuntimeException(e) {
                    tokenizer = new StringTokenizer(reader.readLine());
                } tokenizer = new StringTokenizer(reader.readLine()) tokenizer new StringTokenizer(reader.readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public long nextLong() {
            return Long.parseLong(next());
        } nextLong {
            return Long.parseLong(next());
        } return Long.parseLong(next()); Long.parseLong(next()) Long.parseLong Long next() next public double nextDouble() {
            return Double.parseDouble(next());
        } nextDouble {
            return Double.parseDouble(next());
        } return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public int nextInt() {
            return Integer.parseInt(next());
        } nextInt {
            return Integer.parseInt(next());
        } return Integer.parseInt(next()); Integer.parseInt(next()) Integer.parseInt Integer next() next public char nextChar() {
            return next().charAt(0);
        } nextChar {
            return next().charAt(0);
        } return next().charAt(0); next().charAt(0) next().charAt next() next 0 public String nextLine() throws IOException {
            return reader.readLine().trim();
        } nextLine {
            return reader.readLine().trim();
        } return reader.readLine().trim(); reader.readLine().trim() reader.readLine().trim reader.readLine() reader.readLine reader public class Main {
    // https://atcoder.jp/contests/abc135/tasks/abc135_c
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextLine() throws IOException {
            return reader.readLine().trim();
        }
    }
} public class Main {
    // https://atcoder.jp/contests/abc135/tasks/abc135_c
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextLine() throws IOException {
            return reader.readLine().trim();
        }
    }
} Main


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

public class Main {
    // https://atcoder.jp/contests/abc135/tasks/abc135_c
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
//        int t = in.nextInt();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task {
        public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
            int n = in.nextInt();
            long[] towns = new long[n+1];
            long[] heroes = new long[n];
            for (int i = 0; i < n+1; i++) {
                towns[i] = in.nextLong();
            }
            for (int i = 0; i < n; i++) {
                heroes[i] = in.nextLong();
            }
            long count = 0;
            for (int i = n-1; i >= 0; i--) {
                if (towns[i+1] < heroes[i]){
                    count += towns[i+1];
                    heroes[i] -= towns[i+1];
                    count += Math.min(towns[i], heroes[i]);
                    towns[i] -= Math.min(towns[i], heroes[i]);
                }else{
                    count+= heroes[i];
                    towns[i+1] -= heroes[i];
                }
            }
            out.println(count);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

        public String nextLine() throws IOException {
            return reader.readLine().trim();
        }
    }
}
