#include<bits/stdc++.h>
#define rep(i,l,r) for (int i=l;i<=r;i++)
using namespace std;
typedef long long ll;
ll a,b,c,ans,N,M,T,q[100007],w[100007];
int main(){
	scanf("%lld",&N);
	rep(i,1,N+1) scanf("%lld",&q[i]);
	rep(i,1,N) scanf("%lld",&w[i]);
	ll ans=0;
	rep(i,1,N){
		int mi=min(q[i],w[i]);
		q[i]-=mi;w[i]-=mi;ans+=mi;
		mi=min(q[i+1],w[i]);
		q[i+1]-=mi;ans+=mi;
	}
	printf("%lld\n",ans);
	return 0;
}
