#include <bits/stdc++.h>
using namespace std;
vector<long long> input(int N) {
  int i;
  vector<long long> output(N);
  for (i = 0; i < N; i++) cin >> output[i];
  return output;
}
int main() {
  int N, i;
  long long result = 0;
  vector<long long> A, B;
  cin >> N;
  A = input(N + 1);
  B = input(N);
  for (i = 0; i < N; i++) {
    result += min(A[i], B[i]);
    B[i] -= min(A[i], B[i]);
    result += min(A[i + 1], B[i]);
    A[i + 1] -= min(A[i + 1], B[i]);
  }
  cout << result << endl;
}
