#include <bits/stdc++.h>
int main(void) {
  int A[20];
  int B[50];
  int C[50];
  int N;
  char As[100];
  char Bs[100];
  char Cs[100];
  scanf("%d\n", &N);
  fgets(As, 150, stdin);
  fgets(Bs, 150, stdin);
  fgets(Cs, 150, stdin);
  int i = N;
  while (i > 0) {
    sscanf(As + 2 * (N - i), "%d", &A[N - i]);
    i--;
  }
  i = N;
  while (i > 0) {
    sscanf(Bs + 2 * (N - i), "%d", &B[N - i]);
    i--;
  }
  i = N;
  while (i > 0) {
    sscanf(Cs + 2 * (N - i), "%d", &C[N - i]);
    i--;
  }
  int sum = 0;
  int prev = -1;
  for (int i = 0; i < N; i++) {
    sum += B[A[i] + 1];
    if (prev = A[i] - 1) {
      sum += C[prev];
    }
    prev = A[i];
  }
  printf("%d", sum);
  return 0;
}
