#include <bits/stdc++.h>
using namespace std;
long long int n, a[100100], res = 0;
vector<pair<long long int, long long int> > v[100100];
bool vis[100100] = {0};
void dfs(long long int node, bool d, long long int dis) {
  vis[node] = 1;
  if (d) {
    res++;
  } else if (dis > a[node]) {
    d = 1;
    res++;
  }
  for (int j = 0; j < v[node].size(); j++) {
    if (!vis[v[node][j].first]) {
      long long int dis2 = dis;
      long long int t1 = v[node][j].first;
      long long int t2 = v[node][j].second;
      if (dis2 + t2 > 0)
        dis2 += t2;
      else
        dis2 = 0;
      dfs(t1, d, dis2);
    }
  }
  return;
}
int main() {
  cin >> n;
  long long int x, y;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 2; i <= n; i++) {
    cin >> x >> y;
    v[i].push_back(pair<long long int, long long int>(x, y));
    v[x].push_back(pair<long long int, long long int>(i, y));
  }
  dfs(1, 0, 0);
  cout << res << endl;
}
