#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > adj[100009];
long long arr[100009], dp[100009] = {}, col[100009], ans = 0;
void dfs2(long long u) {
  int i;
  ans++;
  col[u] = 0;
  for (i = 0; i < adj[u].size(); i++) {
    if (col[adj[u][i].first] == -1) {
      dfs2(adj[u][i].first);
    }
  }
  col[u] = 1;
}
void dfs(long long u) {
  int i;
  col[u] = 0;
  for (i = 0; i < adj[u].size(); i++) {
    if (col[adj[u][i].first] == -1) {
      dp[adj[u][i].first] = max(dp[u] + adj[u][i].second, adj[u][i].second);
      if (dp[adj[u][i].first] > arr[adj[u][i].first]) {
        dfs2(adj[u][i].first);
      } else
        dfs(adj[u][i].first);
    }
  }
  col[u] = 1;
}
int main() {
  long long n, i, pi, ci, cnt = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> arr[i];
  for (i = 2; i <= n; i++) {
    cin >> pi >> ci;
    adj[i].push_back({pi, ci});
    adj[pi].push_back({i, ci});
  }
  memset(col, -1, sizeof(col));
  dfs(1);
  cout << ans << endl;
  return 0;
}
