#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
const int mx = 100005;
int n, a[mx], b;
long long ans;
int main(){
	scanf("%d", &n);
	rep(i,n+1) scanf("%d", a+i);
	rep(i,n){
		scanf("%d", &b);
		if(a[i] + a[i+1] >= b){
			ans += b;
			a[i+1] = min(a[i] + a[i+1] - b, a[i+1]);
		}else{
			ans += a[i] + a[i+1];
			a[i+1] = 0;
		}
	}
	printf("%lld\n", ans);
}