import java.util.*;

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

    int N = scn.nextInt();
    int[] Nmonster = new int[N + 1];

    for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    }
    long Nbeaten = 0;
    for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    }

    System.out.println(Nbeaten);

  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int[] Nmonster = new int[N + 1];

    for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    }
    long Nbeaten = 0;
    for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    }

    System.out.println(Nbeaten);

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

    int N = scn.nextInt();
    int[] Nmonster = new int[N + 1];

    for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    }
    long Nbeaten = 0;
    for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    }

    System.out.println(Nbeaten);

  } main {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int[] Nmonster = new int[N + 1];

    for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    }
    long Nbeaten = 0;
    for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    }

    System.out.println(Nbeaten);

  } Scanner scn = new Scanner(System.in); scn new Scanner(System.in) int N = scn.nextInt(); N scn.nextInt() scn.nextInt scn int[] Nmonster = new int[N + 1]; Nmonster new int[N + 1] N + 1 N 1 for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    } int i = 0; int i = 0; i 0 i < N + 1 i N + 1 N 1 i++ i++ i {
      Nmonster[i] = scn.nextInt();
    } {
      Nmonster[i] = scn.nextInt();
    } Nmonster[i] = scn.nextInt() Nmonster[i] Nmonster i scn.nextInt() scn.nextInt scn long Nbeaten = 0; Nbeaten 0 for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    } int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    } {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    } int Nbeatble = scn.nextInt(); Nbeatble scn.nextInt() scn.nextInt scn if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      } Nbeatble < Nmonster[i] Nbeatble Nmonster[i] Nmonster i {
        Nbeaten += Nbeatble;

      } Nbeaten += Nbeatble Nbeaten Nbeatble {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      } Nbeaten += Nmonster[i] Nbeaten Nmonster[i] Nmonster i Nbeatble -= Nmonster[i] Nbeatble Nmonster[i] Nmonster i int diff = Nbeatble - Nmonster[i + 1]; diff Nbeatble - Nmonster[i + 1] Nbeatble Nmonster[i + 1] Nmonster i + 1 i 1 if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        } diff >= 0 diff 0 {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } Nbeaten += Nmonster[i + 1] Nbeaten Nmonster[i + 1] Nmonster i + 1 i 1 Nmonster[i + 1] = 0 Nmonster[i + 1] Nmonster i + 1 i 1 0 {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        } Nbeaten += Nbeatble Nbeaten Nbeatble Nmonster[i + 1] -= Nbeatble Nmonster[i + 1] Nmonster i + 1 i 1 Nbeatble System.out.println(Nbeaten) System.out.println System.out System System.out Nbeaten String[] args args public class Main {
  public static void main(String[] args) {
    Scanner scn = new Scanner(System.in);

    int N = scn.nextInt();
    int[] Nmonster = new int[N + 1];

    for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    }
    long Nbeaten = 0;
    for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    }

    System.out.println(Nbeaten);

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

    int N = scn.nextInt();
    int[] Nmonster = new int[N + 1];

    for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    }
    long Nbeaten = 0;
    for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    }

    System.out.println(Nbeaten);

  }
} Main
import java.util.*;

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

    int N = scn.nextInt();
    int[] Nmonster = new int[N + 1];

    for (int i = 0; i < N + 1; i++) {
      Nmonster[i] = scn.nextInt();
    }
    long Nbeaten = 0;
    for (int i = 0; i < N; i++) {
      int Nbeatble = scn.nextInt();

      if (Nbeatble < Nmonster[i]) {
        Nbeaten += Nbeatble;

      } else {
        Nbeaten += Nmonster[i];
        Nbeatble -= Nmonster[i];
        int diff = Nbeatble - Nmonster[i + 1];
        if (diff >= 0) {
          Nbeaten += Nmonster[i + 1];
          Nmonster[i + 1] = 0;

        } else {
          Nbeaten += Nbeatble;
          Nmonster[i + 1] -= Nbeatble;
        }
      }


    }

    System.out.println(Nbeaten);

  }
}