#include <iostream>
using namespace std;

int main(){
 int N;
  cin >> N;
  int A[2][51];
  int C[51];
  for(int i = 0; i < 2; i++){
   	for(int j = 0; j < N; j++){
     	cin >> A[i][j]; 
    }
  }
  for(int i = 0; i < N-1; i+++)cin >> C[i];
  C[N-1] = 0;
  int before = 0;
  int ans = 0;
  for(int i = 0; i < N; i++){
   	 ans +=A[1][A[0][i]];
    ans += before;
    before = C[A[0][i]];
  }
  cout << ans << endl;
}