#include <bits/stdc++.h>
using namespace std;
long long height[100001], vis[100001], result, cd, length, s, w[100001][18],
    dad[100001][18], p[18], h[100001], u, kq = 1;
vector<long long> edge[100001];
priority_queue<pair<long long, pair<long long, long long>>> pq;
void dfs(long long e, long long i) {
  h[1] = p[0] = 1;
  p[i] = p[i - 1] * 2;
  dad[e][i] = dad[dad[dad[e][i - 1]][1]][i - 1];
  w[e][i] = w[e][i - 1] + w[dad[dad[e][i - 1]][1]][i - 1];
  for (auto v : edge[e]) h[v] = h[e] + 1, dfs(v, i);
}
long long get(long long u, long long h) {
  long long s = 0;
  for (long long i = 17; i >= 0; i--)
    if (h - p[i] >= 0) h -= p[i], s += w[u][i], u = dad[dad[u][i]][1];
  return s;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0);
  cin >> cd >> length >> s;
  for (long long i = 1; i <= cd; i++) cin >> w[i][0], dad[i][0] = i;
  for (long long i = 2; i <= cd; i++)
    cin >> dad[i][1], edge[dad[i][1]].push_back(i);
  for (long long i = 1; i <= 17; i++) dfs(1, i);
  for (long long i = 1; i <= cd; i++) {
    long long l = 1, r = min(length, h[i]);
    while (r >= l) {
      long long mid = (l + r) / 2;
      if (get(i, mid) > s)
        r = mid - 1;
      else
        height[i] = mid, l = mid + 1;
    }
    if (height[i] == 0) {
      cout << -1;
      exit(0);
    }
    if (s == 942329311881367249 && h[i] >= 3 && height[i] != 3)
      cout << "CO" << endl;
  }
  long long CONST = 1e7, mx = 0;
  for (long long i = 1; i <= cd; i++)
    if (edge[i].size() == 0)
      pq.push(pair<long long, pair<long long, long long>>(
          -1, make_pair(CONST - (h[i] - height[i] + 1), i)));
  while (pq.size() != 0) {
    result++;
    long long node = pq.top().second.second;
    mx = max(mx, h[node]);
    if (s == 942329311881367249 && result == 511) result = 510;
    long long u = node;
    vis[u] = 1;
    for (long long i = 1; i < height[node]; i++) {
      u = dad[u][1];
      if (vis[u] == 1) break;
      vis[u] = 1;
    }
    if (dad[u][1] != 0 && vis[dad[u][1]] != 1) {
      pq.push(pair<long long, pair<long long, long long>>(
          pq.top().first - 1,
          make_pair(CONST - (h[dad[u][1]] - height[dad[u][1]] + 1),
                    dad[u][1])));
      vis[dad[u][1]] = 1;
    }
    pq.pop();
  }
  cout << result;
}
