There is a village along a road. This village has $N$ houses numbered $1$ to $N$ in order along the road. Each house has a field that can make up to two units of the crop and needs just one unit of the crop. The total cost to distribute one unit of the crop to each house is the summation of carrying costs and growing costs.

* The carrying cost: The cost to carry one unit of the crop between the $i$-th house and the ($i+1$)-th house is $d_i$. It takes the same cost in either direction to carry.
* The growing cost: The cost to grow one unit of the crop in the $i$-th house's field is $g_i$.



Your task is to calculate the minimum total cost to supply one unit of the crop to each house.



Input

The input consists of a single test case formatted as follows.


$N$
$d_1$ ... $d_{N-1}$
$g_1$ ... $g_{N}$


The first line consists of an integer $N$ ($2 \leq 200,000$), which is the number of the houses. The second line consists of $N-1$ integers separated by spaces. The $i$-th integer $d_i$ ($1 \leq d_i \leq 10^9$, $1 \leq i \leq N-1$)represents the carrying cost between the $i$-th and the ($i+1$)-th houses. The third line consists of $N$ integers separated by spaces. The $i$-th integer $g_i$ ($1 \leq g_i \leq 10^9$, $1 \leq i \leq N$) represents the growing cost of the $i$-th house's field.

Output

Print the minimum cost to supply one unit of the crop to each house.

Examples

Input

2
3
1 5


Output

5


Input

3
100 100
1 2 3


Output

6


Input

4
1 2 3
1 1 100 100


Output

12
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

int main(){
    int n;
    cin >> n;
    vl d(n-1), g(n);
    ll ans = 0;
	rep(i,n-1){
        cin >> d[i];
    }
    rep(i,n){
        cin >> g[i];
        ans += g[i];
    }
	priority_queue<ll> l;
	priority_queue<ll,vector<ll>,greater<ll> > r;
    l.push(g[0]),r.push(g[0]);
    ll lsum = 0, rsum = 0;
	rep(i,n-1){
		lsum += d[i], rsum += d[i];
		if(g[i+1] < l.top()-lsum){
			l.push(g[i+1]+lsum), l.push(g[i+1]+lsum);
			ll val = l.top() - lsum;
			ans -= val - g[i+1];
			l.pop();
			r.push(val-rsum);
		}else if(r.top()+rsum < g[i+1]){
			r.push(g[i+1]-rsum), r.push(g[i+1]-rsum);
			ll val = r.top() + rsum;
            ans -= g[i+1] - val;
			r.pop();
			l.push(val+lsum);
		}else{
			l.push(g[i+1]+lsum);
			r.push(g[i+1]-rsum);
		}
	}
	cout << ans << "\n";
}

