#include <bits/stdc++.h>
using namespace std;
vector<int> g[100002];
int vis[100002];
int ans;
void dfs2(int u) {
  vis[u] = 1;
  ans++;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (!vis[v]) dfs2(v);
  }
}
map<pair<int, int>, int> mp;
int arr[100002];
void dfs(int u, int par, long long dist) {
  vis[u] = 1;
  if (par != -1) dist = max(dist + mp[{u, par}], 1ll * 0);
  if (dist > arr[u]) {
    dfs2(u);
    return;
  }
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (!vis[v]) dfs(v, u, dist);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 2; i <= n; i++) {
    int v, w;
    cin >> v >> w;
    g[v].push_back(i);
    g[i].push_back(v);
    mp[{v, i}] = w;
    mp[{i, v}] = w;
  }
  dfs(1, -1, 0);
  cout << ans << endl;
  return 0;
}
