#include <bits/stdc++.h>
using namespace std;
long long int ans, n, l, s, a[100005], b[100005], mp[100005];
int main() {
  scanf("%lld %lld %lld", &n, &s, &l);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 1; i < n; i++) {
    scanf("%lld", &b[i + 1]);
  }
  for (int i = n; i; i--) {
    if (!mp[i]) {
      long long int x = l, y = s, now = i;
      ans++;
      while (x >= a[now] && y >= 1 && now) {
        mp[now] = 1;
        x -= a[now];
        y--;
        now = b[now];
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!mp[i]) {
      printf("-1");
      return 0;
    }
  printf("%lld", ans);
  return 0;
}
