function Main(input) {
  input = input.split("\n");
  n = input[0].split("");
  a = input[1].split(" ");
  b = input[2].split(" ");
  c = input[3].split(" ");
  var r=-1;
  var ans=0;
  for(var i=0; i<n; i++){
    ans=ans+Number(b[a[i]-1]);
    if (a[i]==r+1){
      ans=ans+Number(c[r-1]);
    }
    r=Number(a[i]);
  }
  console.log(ans);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));