#include <bits/stdc++.h>
using namespace std;
long long n, l, s, w[100001], p[100001], f[100001], ans;
int main() {
  scanf("%I64d%I64d%I64d", &n, &l, &s);
  for (long long i = 1; i <= n; i++) {
    scanf("%I64d", &w[i]);
    if (w[i] > s) return printf("-1\n"), 0;
  }
  for (long long i = 2; i <= n; i++) scanf("%I64d", &p[i]);
  for (long long i = n; i >= 1; i--)
    if (!f[i]) {
      ans++;
      long long cur = i, L = l, S = s;
      while (cur && L && S >= w[cur])
        f[cur] = 1, L--, S -= w[cur], cur = p[cur];
    }
  printf("%I64d\n", ans);
  return 0;
}
