#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int A[21], B[51], C[51];
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> A[i];
  }
  for (int i = 1; i <= n; i++) {
    cin >> B[i];
  }
  for (int i = 1; i < n; i++) {
    cin >> A[i];
  }
  int u = -1, sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += B[A[i]];
    if (u + 1 == A[i]) sum += C[u];
    u = A[i];
  }
  cout << sum;
}
