#include <bits/stdc++.h>
using namespace std;
int visited[100005];
int sum[100005];
int weight[100005];
vector<pair<int, int>> adj[100005];
int counter;
int maxsum;
void dfs(int t, int r) {
  if (r > weight[t]) return;
  counter++;
  for (int i = 0; i < (int)adj[t].size(); i++) {
    dfs(adj[t][i].first, max(r + adj[t][i].second, 0));
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  counter = 0;
  maxsum = 0;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> weight[i];
  }
  for (int i = 1; i < n; i++) {
    int a, d;
    cin >> a >> d;
    adj[--a].push_back({i, d});
  }
  dfs(0, 0);
  cout << n - counter << endl;
}
