#include <bits/stdc++.h>
using namespace std;
int n, ll, w[100010], num, k[100010], fa[100010], head[100010], f[100010],
    ans[100010], dp[100010];
long long s, dis[100010];
vector<int> v;
struct xx {
  int next, to;
} way[100010];
void add(int from, int to) {
  way[++num].next = head[from];
  way[num].to = to;
  head[from] = num;
}
void dfs(int x) {
  v.push_back(x);
  dis[x] = dis[fa[x]] + w[x];
  int l = max(0, (int)v.size() - ll), r = v.size() - 1;
  while (l < r) {
    int mid = (l + r) >> 1;
    if (dis[x] - dis[fa[v[mid]]] <= s)
      r = mid;
    else
      l = mid + 1;
  }
  k[x] = v.size() - 1 - l;
  for (int i = head[x]; i; i = way[i].next) {
    int y = way[i].to;
    dfs(y);
  }
  v.pop_back();
}
void dfss(int x) {
  dp[x] = -1;
  for (int i = head[x]; i; i = way[i].next) {
    int y = way[i].to;
    dfss(y);
    dp[x] = max(dp[x], dp[y] - 1);
    ans[x] += ans[y];
  }
  if (dp[x] == -1) {
    dp[x] = k[x];
    ans[x]++;
  }
}
int main() {
  scanf("%d%d%lld", &n, &ll, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &w[i]);
    if (w[i] > s) {
      cout << "-1";
      return 0;
    }
  }
  for (int i = 2; i <= n; i++) {
    int g;
    scanf("%d", &g);
    fa[i] = g;
    add(g, i);
  }
  dfs(1);
  dfss(1);
  printf("%d", ans[1]);
  return 0;
}
