#include <bits/stdc++.h>
using namespace std;
int n, L, nowl, ans, now, i, mp[100001], fa[100001];
long long S, a[100001], nows, mx;
int main() {
  scanf("%d%d%lld", &n, &L, &S);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    mx = max(mx, a[i]);
  }
  if (mx > S) {
    puts("-1");
    return 0;
  }
  for (i = 2; i <= n; i++) scanf("%d", &fa[i]);
  for (i = n; i; i--)
    if (!mp[i]) {
      ans++;
      nowl = L;
      nows = S;
      now = i;
      while (now && nowl > 0 && nows >= a[now]) {
        mp[now] = 1;
        nowl--;
        nows -= a[now];
        now = fa[now];
      }
    }
  printf("%d", ans);
}
