#include <bits/stdc++.h>
using namespace std;
long long n, l, s, i, x = 1, w[100005], p[100005], d[100005], f[100005][20],
                      t[100005][20], ans, ss;
vector<long long> g[100005];
void dfs1(long long u) {
  long long v, k = w[u];
  for (long long i = 1; i <= ss; i++)
    f[u][i] = f[v = f[u][i - 1]][i - 1], t[u][i] = t[u][i - 1] + t[v][i - 1];
  for (long long i = 0; i < g[u].size(); i++) {
    v = g[u][i], f[v][0] = u, t[v][0] = w[u], d[v] = d[u] + 1;
    dfs1(v);
    if (d[p[v]] < d[p[u]]) p[u] = p[v];
  }
  if (d[p[u]] > d[u]) {
    v = u;
    for (long long i = ss; i >= 0; i--)
      if (d[u] - d[f[v][i]] <= l && k + t[v][i] <= s) k += t[v][i], v = f[v][i];
    ans++, p[u] = v;
  }
}
int main() {
  scanf("%lld%lld%lld", &n, &l, &s);
  if (!l) ans = -1;
  l--, d[n + 1] = n + 1, t[1][0] = s + 1;
  while (x < n) x <<= 1, ss++;
  for (i = 1; i <= n; i++) {
    scanf("%lld", &w[i]);
    if (w[i] > s) ans = -1;
    p[i] = n + 1;
  }
  if (ans == -1) {
    cout << -1 << endl;
    return 0;
  }
  for (i = 2; i <= n; i++) {
    scanf("%lld", &x);
    g[x].push_back(i);
  }
  d[1] = 1, dfs1(1);
  cout << ans << endl;
  return 0;
}
