#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int, int>>> adj(200000);
int a[200000];
int ans = 0;
void dfs(int v, int d) {
  if (d > a[v]) {
    return;
  }
  ans++;
  for (int i = 0; i < adj[v].size(); ++i) {
    dfs(adj[v][i].first, max(0, adj[v][i].second + d));
  }
}
int main() {
  int n, x, y;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n - 1; i++) {
    cin >> x >> y;
    adj[x].push_back(make_pair(i + 1, y));
  }
  dfs(1, 0);
  cout << n - ans;
  return 0;
}
