
#include <iostream>
#include <limits>
#include <chrono>
#include <random>
#include <iomanip>
#include <algorithm>
#include <chrono>
#include <random>
#include <math.h>
#include <set>
using namespace std;
const int maxn = 3e5 + 1;
int t = 0;
int tin[maxn], tout[maxn], min_v[maxn],sz[maxn];
vector <int> g[maxn];
void dfs(int u, int min_val, vector <int>& weight) {
	tin[u] = t++;
	sz[u] = 1;
	int val = min(min_val, weight[u]);
	min_v[u] = val;
	for (auto el : g[u]) {
		dfs(el, val, weight);
		sz[u] += sz[el];
	}
	tout[u] = t;
}
int dfs2(int u, int min_val, vector <int>& w, vector <int>& dp, int z) {
	min_val = min(min_val, w[u]);
	if (min_val > z) {
		return sz[u];
	}
	return 0;
}
bool dfs1(int u, int& min_val, vector <int>& dp, vector <int>& color, int last, vector <int>& w) {
	if (u == last) {
		min_val = w[u];
		return 1;
	}
	int pos = -1;
	for (auto el : g[u]) {
		if (dfs1(el, min_val, dp, color, last, w)) {
			pos = el;
			break;
		}
	}
	return 0;
}
signed main()
{
	int n, q;
	cin >> n >> q;
	vector <int> p(n, -1);
	for (int i = 1;i < n;i++) {
		int pi;
		cin >> pi;
		pi--;
		p[i] = pi;
		g[pi].push_back(i);
	}
	vector <int> w(n);
	for (int i = 0;i < n;i++) {
		cin >> w[i];
	}
	vector <int> ans;
	while (q--) {
		int vert;
		cin >> vert;
		vert--;
		int vert1 = vert;
		vector <int> color(n, 0);
		vector <int> dp(n);
		int cnt = 0;
		int z = w[vert];
		int pos_now = 0;
		int mv = 0;
		while (p[vert] != -1) {
			cnt++;
			for (auto el : g[p[vert]]) {
				if (el == vert)continue;
				int c = dfs2(el, w[el], w, dp, z);
				pos_now += c;
				mv = max(mv, c);
			}
			z = min(z, w[p[vert]]);
			vert = p[vert];
		}
		cout << pos_now - mv + cnt << "\n";
	}
}
