#include <bits/stdc++.h>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
using namespace std;
typedef unsigned int ll;
typedef long long ll;
typedef struct{
ll strength;
ll cost;
} pole_s;
int main(){
ll d;
ll transmitter;
cin >> d;
cin >> transmitter;
pole_s *poles = (pole_s*) malloc(sizeof(pole_s) * (d - 1));
for(ll i = 0; i < d - 1; i++)
cin >> poles[i].strength;
for(ll i = 0; i < d - 1; i++)
cin >> poles[i].cost;
ll totalCoverage = transmitter;
ll totalCost = 0;
ll minPoint = 0;
while(1){
if(totalCoverage >= d) break;
ll best = 0;
ll bestCompare = -999999999999;
for(ll i = max(0, minPoint - 1); i < totalCoverage; i++) {
ll max = (ll)i + (ll)poles[i].strength + 1LL;
ll min = (ll)i - (ll)poles[i].strength + 1LL;
ll increase = min(max, d) - (ll)totalCoverage;
ll compare = increase - (ll)poles[i].cost;
if((compare >= bestCompare) && (increase > 0)) {
best = i;
bestCompare = compare;
minPoint = min;
}
}
totalCost += poles[best].cost;
totalCoverage = best + poles[best].strength + 1;
}
cout << totalCost << '\n';
}