#include <bits/stdc++.h>
using namespace std;
long long int a[21] = {}, b[21] = {}, c[21] = {};
long long int max1 = 0;
long long int n;
void ans(long long int i, long long int sum) {
  long long int sum1;
  if (i >= n) {
    if (max1 < sum) {
      max1 = sum;
    }
    return;
  }
  if (b[a[i] - 1] != 0) {
    sum = sum + b[a[i] - 1];
    b[a[i] - 1] = 0;
    if (a[i] != n && b[a[i]] != 0) {
      long long int temp;
      sum1 = sum + b[a[i]] + c[a[i] - 1];
      temp = b[a[i]];
      b[a[i]] = 0;
      ans(i + 1, sum1);
      b[a[i]] = temp;
    }
  }
  ans(i + 1, sum);
}
int main() {
  cin >> n;
  long long int i;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (i = 0; i < n - 1; i++) {
    cin >> c[i];
  }
  ans(0, 0);
  cout << max1 << endl;
}
