#include <bits/stdc++.h>
using namespace std;
int n, x, y;
int a[30], b[30], c[30];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  int sum = 0;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
    sum += b[i];
  }
  for (int i = 1; i <= n - 1; i++) {
    cin >> c[i];
  }
  cout << sum << endl;
  for (int i = 2; i <= n; i++) {
    if (a[i] == a[i - 1] + 1) sum += c[a[i - 1]];
  }
  cout << sum;
}
