#include <bits/stdc++.h>
using namespace std;
long long int a[100005], output;
vector<pair<int, long long int>> lulz[100005];
void dfsSolve(int u, int root, long long int inCome) {
  if (inCome > a[u])
    return;
  else
    output++;
  for (int i = 0, range = lulz[u].size(); i < range; i++)
    if (lulz[u][i].first != root) {
      dfsSolve(lulz[u][i].first, u,
               max(inCome + lulz[u][i].second, lulz[u][i].second));
    }
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  long long int p, q;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i < n; i++) {
    cin >> p >> q;
    lulz[i + 1].push_back({p, q});
    lulz[p].push_back({i + 1, q});
  }
  dfsSolve(1, 0, 0ll);
  output = n - output;
  cout << output;
  return 0;
}
