#include <iostream>
using namespace std;

int n,t,a[20],b,c;

int main()
{
	cin >> n;
	for (size_t i = 0; i < n; i++)
	{
		cin >> t;
		a[t - 1] = i;
	}
	int ans = 0;
	for (size_t i = 0; i < n; i++)
	{
		cin >> b;
		ans += b;
	}
	for (size_t i = 0; i < n - 1; i++)
	{
		cin >> c;
		if (a[i] + 1 == a[i + 1])
		{
			ans += c;
		}
	}
	cout << ans;
}