#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, num, prevnum, total = 0;
  queue<int> order;
  cin >> n;
  cin >> prevnum;
  for (int i = 1; i < n; i++) {
    cin >> num;
    if (prevnum + 1 == num) {
      order.push(prevnum);
    }
    prevnum = num;
  }
  for (int i = 0; i < n; i++) {
    cin >> num;
    total += num;
  }
  for (int i = 1; i < n; i++) {
    cin >> num;
    if (i == order.front()) {
      total += num;
      order.pop();
    }
  }
  cout << total;
}
