
#include <iostream>
using namespace std;
 
int main()
{
	int n,a[25],ans=0;
	cin >> n;
	for (int i = 1; i <=n; i++) {
		int k;
		cin >> k;
		a[k] = i;
	}
	for (int i = 1; i <= n; i++) {
		int b;
		cin >> b;
		ans += b;
	}
	for (int i = 1; i < n; i++) {
		int c;
		cin >> c;
		if (a[i + 1] == a[i] + 1)
			ans += c;
	}
	cout << ans << endl;
	return 0;
}