#include <iostream>
using namespace std;

int main(){
	int n,a[100010],b[100010];
	long long ans;
	ans = 0;
	cin>>n;
	for(int i=1;i<=n+1;i++)
		cin>>a[i];
	for(int i=1;i<=n;i++)
		cin>>b[i];
	for(int i=1;i<=n;i++){
		b[i] -= a[i];
		if(b[i] >= 0){
			ans += min(a[i+1],b[i]) + a[i];
			a[i+1] -= min(a[i+1],b[i]);
		}
		else
			ans += (b[i]+a[i]);
	}
	cout<<ans<<endl;
	
} 