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


public class Main {

    private static List<List<Integer>> subsets;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        int [] a = new int[n+1];
        int [] b = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        }
        out.println(ans);
        out.flush();
    }
    static int toBinary(int n) {
        String  s = Integer.toBinaryString(n);
        return Integer.parseInt(s);
    }
    static int numberOfDigits(int n) {
        int count = 0;
        while (n>0) {
            n/=10;
            count++;
        }
        return count;
    }
    static int gcd(int a,int b) {
        return b == 0 ? a : gcd(b,a%b);
    }
    static char [] convert(char [] c) {
        for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        }
        return c;
    }
    static char [] shift(char [] c) {
        char temp = c[c.length - 1];
        for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        }
        c[0] = temp;
        return c;
    }
    static void subsets(int [] a, int index, List<Integer> list) {
        subsets.add(new ArrayList<>(list));
        for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        }
    }
    static long sum(long n) {
        return n*(n+1)/2;
    }

    static int lcm(int a,int b,int gcd) {
        return a*b/gcd;
    }

}
class Point {
    int x;
    int y;
    public int getX() {
        return x;
    }
    public int getY() {
        return y;
    }
    public Point(int x,int y) {
        this.x = x;
        this.y = y;
    }
}
class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    }
    public Integer nextInt() {return Integer.valueOf(next());}
    public Long nextLong() {return  Long.valueOf(next());}
    public Double nextDouble() {return Double.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

    private static List<List<Integer>> subsets;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        int [] a = new int[n+1];
        int [] b = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        }
        out.println(ans);
        out.flush();
    }
    static int toBinary(int n) {
        String  s = Integer.toBinaryString(n);
        return Integer.parseInt(s);
    }
    static int numberOfDigits(int n) {
        int count = 0;
        while (n>0) {
            n/=10;
            count++;
        }
        return count;
    }
    static int gcd(int a,int b) {
        return b == 0 ? a : gcd(b,a%b);
    }
    static char [] convert(char [] c) {
        for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        }
        return c;
    }
    static char [] shift(char [] c) {
        char temp = c[c.length - 1];
        for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        }
        c[0] = temp;
        return c;
    }
    static void subsets(int [] a, int index, List<Integer> list) {
        subsets.add(new ArrayList<>(list));
        for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        }
    }
    static long sum(long n) {
        return n*(n+1)/2;
    }

    static int lcm(int a,int b,int gcd) {
        return a*b/gcd;
    }

} Main private static List<List<Integer>> subsets; subsets public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        int [] a = new int[n+1];
        int [] b = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        }
        out.println(ans);
        out.flush();
    } main {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        int [] a = new int[n+1];
        int [] b = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        }
        out.println(ans);
        out.flush();
    } 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) InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream); out new InputReader.OutputWriter(outputStream) int n = in.nextInt(); n in.nextInt() in.nextInt in int [] a = new int[n+1]; a new int[n+1] n+1 n 1 int [] b = new int[n]; b new int[n] n for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        } int i = 0; int i = 0; i 0 i < a.length i a.length a a.length i++ i++ i {
            a[i]=in.nextInt();
        } {
            a[i]=in.nextInt();
        } a[i]=in.nextInt() a[i] a i in.nextInt() in.nextInt in for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        } int i = 0; int i = 0; i 0 i < b.length i b.length b b.length i++ i++ i {
            b[i] = in.nextInt();
        } {
            b[i] = in.nextInt();
        } b[i] = in.nextInt() b[i] b i in.nextInt() in.nextInt in long ans = 0; ans 0 for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        } int i = 0; int i = 0; i 0 i < b.length i b.length b b.length i++ i++ i {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        } {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        } int sum = a[i] + a[i+1]; sum a[i] + a[i+1] a[i] a i a[i+1] a i+1 i 1 ans+=(long) Math.min(b[i],sum) ans (long) Math.min(b[i],sum) Math.min Math b[i] b i sum if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            } a[i] <  b[i] a[i] a i b[i] b i {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            } int diff = b[i] - a[i]; diff b[i] - a[i] b[i] b i a[i] a i a[i+1] = a[i+1] - Math.min(a[i+1],diff) a[i+1] a i+1 i 1 a[i+1] - Math.min(a[i+1],diff) a[i+1] a i+1 i 1 Math.min(a[i+1],diff) Math.min Math a[i+1] a i+1 i 1 diff out.println(ans) out.println out ans out.flush() out.flush out String[] args args static int toBinary(int n) {
        String  s = Integer.toBinaryString(n);
        return Integer.parseInt(s);
    } toBinary {
        String  s = Integer.toBinaryString(n);
        return Integer.parseInt(s);
    } String  s = Integer.toBinaryString(n); s Integer.toBinaryString(n) Integer.toBinaryString Integer n return Integer.parseInt(s); Integer.parseInt(s) Integer.parseInt Integer s int n n static int numberOfDigits(int n) {
        int count = 0;
        while (n>0) {
            n/=10;
            count++;
        }
        return count;
    } numberOfDigits {
        int count = 0;
        while (n>0) {
            n/=10;
            count++;
        }
        return count;
    } int count = 0; count 0 while (n>0) {
            n/=10;
            count++;
        } n>0 n 0 {
            n/=10;
            count++;
        } n/=10 n 10 count++ count return count; count int n n static int gcd(int a,int b) {
        return b == 0 ? a : gcd(b,a%b);
    } gcd {
        return b == 0 ? a : gcd(b,a%b);
    } return b == 0 ? a : gcd(b,a%b); b == 0 ? a : gcd(b,a%b) b == 0 b 0 a gcd(b,a%b) gcd b a%b a b int a a int b b static char [] convert(char [] c) {
        for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        }
        return c;
    } convert {
        for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        }
        return c;
    } for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        } int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        } {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        } char current = c[i]; current c[i] c i if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            } current == '9' current '9' {
                c[i] = '0';
            } c[i] = '0' c[i] c i '0' {
                c[i] = ++c[i];
            } c[i] = ++c[i] c[i] c i ++c[i] c[i] c i return c; c char [] c c static char [] shift(char [] c) {
        char temp = c[c.length - 1];
        for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        }
        c[0] = temp;
        return c;
    } shift {
        char temp = c[c.length - 1];
        for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        }
        c[0] = temp;
        return c;
    } char temp = c[c.length - 1]; temp c[c.length - 1] c c.length - 1 c.length c c.length 1 for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        } int i = 0; int i = 0; i 0 i < c.length i c.length c c.length i++ i++ i {
            char current = c[i];
            c[i] = temp;
            temp = current;
        } {
            char current = c[i];
            c[i] = temp;
            temp = current;
        } char current = c[i]; current c[i] c i c[i] = temp c[i] c i temp temp = current temp current c[0] = temp c[0] c 0 temp return c; c char [] c c static void subsets(int [] a, int index, List<Integer> list) {
        subsets.add(new ArrayList<>(list));
        for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        }
    } subsets {
        subsets.add(new ArrayList<>(list));
        for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        }
    } subsets.add(new ArrayList<>(list)) subsets.add subsets new ArrayList<>(list) for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        } int i = index; int i = index; i index i < a.length i a.length a a.length i++ i++ i {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        } {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        } list.add(a[i]) list.add list a[i] a i subsets(a,i+1,list) subsets a i+1 i 1 list list.remove(list.size() - 1) list.remove list list.size() - 1 list.size() list.size list 1 int [] a a int index index List<Integer> list list static long sum(long n) {
        return n*(n+1)/2;
    } sum {
        return n*(n+1)/2;
    } return n*(n+1)/2; n*(n+1)/2 n*(n+1) n (n+1) n 1 2 long n n static int lcm(int a,int b,int gcd) {
        return a*b/gcd;
    } lcm {
        return a*b/gcd;
    } return a*b/gcd; a*b/gcd a*b a b gcd int a a int b b int gcd gcd class Point {
    int x;
    int y;
    public int getX() {
        return x;
    }
    public int getY() {
        return y;
    }
    public Point(int x,int y) {
        this.x = x;
        this.y = y;
    }
} Point int x; x int y; y public int getX() {
        return x;
    } getX {
        return x;
    } return x; x public int getY() {
        return y;
    } getY {
        return y;
    } return y; y public Point(int x,int y) {
        this.x = x;
        this.y = y;
    } Point {
        this.x = x;
        this.y = y;
    } this.x = x this.x this this.x x this.y = y this.y this this.y y int x x int y y class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    }
    public Integer nextInt() {return Integer.valueOf(next());}
    public Long nextLong() {return  Long.valueOf(next());}
    public Double nextDouble() {return Double.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
} InputReader StringTokenizer tokenizer; tokenizer public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    } InputReader {
        super(new InputStreamReader(inputStream), 32768);
    } super(new InputStreamReader(inputStream), 32768) super new InputStreamReader(inputStream) 32768 InputStream inputStream inputStream public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    } InputReader {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    } super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename))) super new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)) String filename filename public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    } next {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    } while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        } tokenizer == null || !tokenizer.hasMoreTokens() tokenizer == null tokenizer null !tokenizer.hasMoreTokens() tokenizer.hasMoreTokens() tokenizer.hasMoreTokens tokenizer {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        } try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            } catch (IOException e) {
                throw new RuntimeException();
            } IOException e {
                throw new RuntimeException();
            } throw new RuntimeException(); new RuntimeException() {
                tokenizer = new StringTokenizer(readLine());
            } tokenizer = new StringTokenizer(readLine()) tokenizer new StringTokenizer(readLine()) return tokenizer.nextToken(); tokenizer.nextToken() tokenizer.nextToken tokenizer public Integer nextInt() {return Integer.valueOf(next());} nextInt {return Integer.valueOf(next());} return Integer.valueOf(next()); Integer.valueOf(next()) Integer.valueOf Integer next() next public Long nextLong() {return  Long.valueOf(next());} nextLong {return  Long.valueOf(next());} return  Long.valueOf(next()); Long.valueOf(next()) Long.valueOf Long next() next public Double nextDouble() {return Double.valueOf(next());} nextDouble {return Double.valueOf(next());} return Double.valueOf(next()); Double.valueOf(next()) Double.valueOf Double next() next static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    } OutputWriter public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        } OutputWriter {
            super(outputStream);
        } super(outputStream) super outputStream OutputStream outputStream outputStream public OutputWriter(Writer writer) {
            super(writer);
        } OutputWriter {
            super(writer);
        } super(writer) super writer Writer writer writer public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        } OutputWriter {
            super(filename);
        } super(filename) super filename String filename filename public void close() {
            super.close();
        } close {
            super.close();
        } super.close() super.close super PrintWriter BufferedReader public class Main {

    private static List<List<Integer>> subsets;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        int [] a = new int[n+1];
        int [] b = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        }
        out.println(ans);
        out.flush();
    }
    static int toBinary(int n) {
        String  s = Integer.toBinaryString(n);
        return Integer.parseInt(s);
    }
    static int numberOfDigits(int n) {
        int count = 0;
        while (n>0) {
            n/=10;
            count++;
        }
        return count;
    }
    static int gcd(int a,int b) {
        return b == 0 ? a : gcd(b,a%b);
    }
    static char [] convert(char [] c) {
        for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        }
        return c;
    }
    static char [] shift(char [] c) {
        char temp = c[c.length - 1];
        for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        }
        c[0] = temp;
        return c;
    }
    static void subsets(int [] a, int index, List<Integer> list) {
        subsets.add(new ArrayList<>(list));
        for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        }
    }
    static long sum(long n) {
        return n*(n+1)/2;
    }

    static int lcm(int a,int b,int gcd) {
        return a*b/gcd;
    }

} public class Main {

    private static List<List<Integer>> subsets;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        int [] a = new int[n+1];
        int [] b = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        }
        out.println(ans);
        out.flush();
    }
    static int toBinary(int n) {
        String  s = Integer.toBinaryString(n);
        return Integer.parseInt(s);
    }
    static int numberOfDigits(int n) {
        int count = 0;
        while (n>0) {
            n/=10;
            count++;
        }
        return count;
    }
    static int gcd(int a,int b) {
        return b == 0 ? a : gcd(b,a%b);
    }
    static char [] convert(char [] c) {
        for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        }
        return c;
    }
    static char [] shift(char [] c) {
        char temp = c[c.length - 1];
        for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        }
        c[0] = temp;
        return c;
    }
    static void subsets(int [] a, int index, List<Integer> list) {
        subsets.add(new ArrayList<>(list));
        for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        }
    }
    static long sum(long n) {
        return n*(n+1)/2;
    }

    static int lcm(int a,int b,int gcd) {
        return a*b/gcd;
    }

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


public class Main {

    private static List<List<Integer>> subsets;

    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        InputReader.OutputWriter out = new InputReader.OutputWriter(outputStream);

        int n = in.nextInt();
        int [] a = new int[n+1];
        int [] b = new int[n];
        for (int i = 0; i < a.length; i++) {
            a[i]=in.nextInt();
        }
        for (int i = 0; i < b.length; i++) {
            b[i] = in.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < b.length; i++) {
            int sum = a[i] + a[i+1];
            ans+=(long) Math.min(b[i],sum);
            if(a[i] <  b[i]) {
                int diff = b[i] - a[i];
                a[i+1] = a[i+1] - Math.min(a[i+1],diff);
            }
          //  out.println(Arrays.toString(a));
        }
        out.println(ans);
        out.flush();
    }
    static int toBinary(int n) {
        String  s = Integer.toBinaryString(n);
        return Integer.parseInt(s);
    }
    static int numberOfDigits(int n) {
        int count = 0;
        while (n>0) {
            n/=10;
            count++;
        }
        return count;
    }
    static int gcd(int a,int b) {
        return b == 0 ? a : gcd(b,a%b);
    }
    static char [] convert(char [] c) {
        for (int i = 0; i < c.length; i++) {
            char current = c[i];
            if (current == '9') {
                c[i] = '0';
            }
            else {
                c[i] = ++c[i];
            }
        }
        return c;
    }
    static char [] shift(char [] c) {
        char temp = c[c.length - 1];
        for (int i = 0; i < c.length;i++) {
            char current = c[i];
            c[i] = temp;
            temp = current;
        }
        c[0] = temp;
        return c;
    }
    static void subsets(int [] a, int index, List<Integer> list) {
        subsets.add(new ArrayList<>(list));
        for (int i = index; i < a.length; i++) {
            list.add(a[i]);
            subsets(a,i+1,list);
            list.remove(list.size() - 1);
        }
    }
    static long sum(long n) {
        return n*(n+1)/2;
    }

    static int lcm(int a,int b,int gcd) {
        return a*b/gcd;
    }

}
class Point {
    int x;
    int y;
    public int getX() {
        return x;
    }
    public int getY() {
        return y;
    }
    public Point(int x,int y) {
        this.x = x;
        this.y = y;
    }
}
class InputReader extends BufferedReader {
    StringTokenizer tokenizer;

    public InputReader(InputStream inputStream) {
        super(new InputStreamReader(inputStream), 32768);
    }

    public InputReader(String filename) {
        super(new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(filename)));
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(readLine());
            } catch (IOException e) {
                throw new RuntimeException();
            }
        }
        return tokenizer.nextToken();
    }
    public Integer nextInt() {return Integer.valueOf(next());}
    public Long nextLong() {return  Long.valueOf(next());}
    public Double nextDouble() {return Double.valueOf(next());}

    static class OutputWriter extends PrintWriter {
        public OutputWriter(OutputStream outputStream) {
            super(outputStream);
        }

        public OutputWriter(Writer writer) {
            super(writer);
        }

        public OutputWriter(String filename) throws FileNotFoundException {
            super(filename);
        }

        public void close() {
            super.close();
        }
    }
}