#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  long long val[n];
  long long cur[n];
  for (long long i = 0; i < n; i++) {
    cin >> val[i];
  }
  vector<pair<long long, long long> > adj[n];
  for (long long i = 1; i < n; i++) {
    long long s, c;
    cin >> s >> c;
    s--;
    adj[s].push_back(make_pair(i, c));
    adj[i].push_back(make_pair(s, c));
  }
  bool used[n];
  bool swit[n];
  for (long long i = 0; i < n; i++) {
    used[i] = false;
    swit[i] = false;
  }
  long long rem = 0;
  queue<long long> q;
  q.push(0);
  used[0] = true;
  cur[0] = 0;
  while (!q.empty()) {
    long long fr = q.front();
    q.pop();
    if (swit[fr] or cur[fr] > val[fr]) {
      swit[fr] = true;
      rem++;
    }
    for (long long i = 0; i < adj[fr].size(); i++) {
      long long next = adj[fr][i].first;
      if (!used[next]) {
        used[next] = true;
        cur[next] = max(0LL, cur[fr]) + adj[fr][i].second;
        swit[next] |= swit[fr];
        q.push(next);
      }
    }
  }
  cout << rem;
}
