#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
const int mod = 1e9 + 7;
int n, L, ans;
long long S;
int w[maxn];
int up[maxn], down[maxn];
int f[maxn][20], dep[maxn];
long long sum[maxn];
vector<int> g[maxn];
void dfs(int u, int fa) {
  dep[u] = dep[fa] + 1;
  sum[u] = sum[fa] + w[u];
  up[u] = u;
  f[u][0] = fa;
  for (int j = 1; (1 << j) <= dep[u]; j++) f[u][j] = f[f[u][j - 1]][j - 1];
  int num = L;
  for (int i = 19; i >= 0; i--) {
    int no = f[up[u]][i];
    if (!no || (1 << i) >= num) continue;
    if (sum[u] - sum[no] + w[no] > S) continue;
    num -= (1 << i);
    up[u] = no;
  }
  for (auto v : g[u]) {
    if (v != fa) dfs(v, u);
  }
}
void _dfs(int u, int fa) {
  int best = -1;
  for (auto v : g[u]) {
    if (v == fa) continue;
    _dfs(v, u);
    if (down[v] == v) continue;
    if (best == -1 || dep[best] > dep[down[v]]) {
      best = down[v];
    }
  }
  if (best == -1) {
    best = up[u];
    ans++;
  }
  down[u] = best;
}
int main() {
  cin >> n >> L >> S;
  int ma = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &w[i]);
    ma = max(ma, w[i]);
  }
  for (int u = 2, v; u <= n; u++) {
    scanf("%d", &v);
    g[u].push_back(v);
    g[v].push_back(u);
  }
  if (ma > S) {
    puts("-1");
    return 0;
  }
  dfs(1, 0);
  ans = 0;
  _dfs(1, 0);
  cout << ans << '\n';
  return 0;
}
