#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
using namespace std;

template<typename T1,typename T2>
istream&operator>>(istream&in,pair<T1,T2>&a){
    return in>>a.first>>a.second;
}
template<typename T1,typename T2>
ostream&operator<<(ostream&out,const pair<T1,T2>&a){
    return out<<a.first<<' '<<a.second<<'\n';
}
template<typename T>
istream&operator>>(istream&in,vector<T>&a){
    for (auto &i:a)in>>i;
    return in;
}
template<typename T>
ostream&operator<<(ostream&out,const vector<T>&a){
    for (const auto &i:a)out<<i<<' ';
    return out;
}
template<typename T>
ostream&operator<<(ostream&out,const vector<vector<T>>&a){
    for (const auto &i:a)out<<i<<'\n';
    return out;
}
typedef long long ll;
const int inf =1e9+7;
struct solve{
    int n,q;
    vector<int>a;
    vector<vector<int>>g;
    vector<int>p;
    vector<int>queries;
    int count_dfs(int v, int x, int not_u){
        if (a[v]<x && not_u==-1)return 0;
        int ans=1;
        for (auto u:g[v]){
            if (u==not_u)continue;
            ans+=count_dfs(u,x,-1);
        }
        return ans;
    }
    int get(int v){
        int now=v;
        int ans=0;
        int mn=a[v];
        while (now!=0){
            int last=now;
            now=p[now];
            ans+=count_dfs(now,mn,last);
            mn=min(mn,a[now]);

        }
        return ans;
    }

    solve(){
        cin>>n>>q;
        a.resize(n);
        p.resize(n,0);
        queries.resize(q);
        g.resize(n);
        for (int i=1;i<n;i++){
            cin>>p[i];
            p[i]--;
            g[p[i]].push_back(i);
        }
        cin>>a>>queries;
        for (auto qq:queries){
            int ans=n+2;
            qq--;
            for (int i=0;i<n;++i){
                int t=a[i];
                a[i]=0;
                ans=min(ans,get(qq));
                a[i]=t;
            }
            cout<<ans<<' ';
        }
    }
};
int main()
{
    int t=1;
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    while(t--)solve();
}
