#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int *a = (int *)malloc(n * sizeof(int));
  int *prv = (int *)malloc(n * sizeof(int));
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) prv[a[i]] = a[i - 1];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int b;
    cin >> b;
    ans += b;
  }
  for (int i = 1; i < n; i++) {
    int c;
    cin >> c;
    if (prv[i + 1] == i) ans += c;
  }
  cout << ans;
  free(a);
  free(prv);
  return 0;
}
