n = gets.to_i
a = gets.split.map(&:to_i)
b = gets.split.map(&:to_i)

ans = 0
n.times{|i|
  if a[i]<=b[i]
    b[i] -= a[i]
    ans += a[i]
    a[i] = 0
  else
    a[i] -= b[i]
    ans += b[i]
    b[i] = 0
  end
  
  if a[i+1]<=b[i]
    b[i] -= a[i+1]
    ans += a[i+1]
    a[i+1] = 0
  else
    a[i+1] -= b[i]
    ans += b[i]
    b[i] = 0
  end
}

p ans