#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
int w[MAXN], fa[MAXN];
int dfn[MAXN];
vector<int> G[MAXN];
bool vis[MAXN];
void bfs(int s) {
  queue<int> q;
  q.push(s);
  int cnt = 0;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    vis[u] = 1, dfn[++cnt] = u;
    for (int i = 0; i < G[u].size(); i++) {
      int v = G[u][i];
      if (vis[v]) continue;
      q.push(v);
    }
  }
}
int main() {
  int n, l;
  long long s;
  scanf("%d%d%lld", &n, &l, &s);
  int mxx = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &w[i]);
    mxx = max(mxx, w[i]);
  }
  for (int i = 2; i <= n; i++) {
    scanf("%d", &fa[i]);
    G[fa[i]].push_back(i);
  }
  if (mxx > s)
    puts("-1");
  else {
    bfs(1);
    memset(vis, 0, sizeof(vis));
    int ans = 0;
    for (int i = n; i >= 1; i--) {
      int u = dfn[i];
      if (vis[u]) continue;
      ans++;
      int nowl = l;
      long long nows = s;
      while (u && nowl > 0 && nows >= w[u])
        nowl--, nows -= w[u], vis[u] = 1, u = fa[u];
    }
    printf("%d\n", ans);
  }
  return 0;
}
