#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
const double eps = 1e-8;
struct edge {
  int u, v, ne;
} e[maxn];
int n, al, ans;
int head[maxn], len;
long long s, w[maxn], dis[maxn], val[maxn];
int num[maxn];
void add(int u, int v) {
  e[len].u = u;
  e[len].v = v;
  e[len].ne = head[u];
  head[u] = len++;
}
void dfs(int x, int p, int deep) {
  dis[x] = dis[p] + w[x];
  int maxh = 0, tag = -1;
  for (int i = head[x]; ~i; i = e[i].ne) {
    int v = e[i].v;
    if (v == p) continue;
    dfs(v, x, deep + 1);
    int l = 1, r = min(deep, al - num[v]);
    while (l <= r) {
      int mid = (l + r) >> 1;
      long long tmp = dis[x] - dis[deep - mid];
      if (tmp > s - val[v])
        r = mid - 1;
      else
        l = mid + 1;
    }
    ans++;
    if (r > maxh) {
      maxh = r;
      tag = v;
    }
  }
  if (tag == -1) {
    num[x] = 1;
    val[x] = w[x];
  } else {
    ans--;
    num[x] = num[tag] + 1;
    val[x] = val[tag] + w[x];
  }
  return;
}
int main() {
  memset(head, -1, sizeof(head));
  cin >> n >> al >> s;
  int flag = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &w[i]);
    if (w[i] > s) flag = 0;
  }
  for (int i = 2, x; i <= n; i++) {
    scanf("%d", &x);
    add(x, i);
  }
  if (!flag) {
    cout << -1 << endl;
    return 0;
  }
  dfs(1, 0, 1);
  ans++;
  cout << ans << endl;
  return 0;
}
