#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e5 + 7;
long long n, t, w[Maxn];
vector<pair<int, long long> > nei[Maxn];
bool cut[Maxn], mark[Maxn];
void dfs(int v, long long dist) {
  mark[v] = true;
  if (dist > w[v]) cut[v] = true;
  for (int i = 0; i < (int)nei[v].size(); i++) {
    int u = nei[v][i].first;
    if (!mark[u]) {
      if (cut[v] == true) cut[u] = true;
      dfs(u, max(1ll * 0, dist + nei[v][i].second));
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> w[i];
  }
  for (int i = 0, a, b; i < n - 1; i++) {
    cin >> a >> b;
    nei[i + 1].push_back(make_pair(a - 1, b));
    nei[a - 1].push_back(make_pair(i + 1, b));
  }
  dfs(0, 0);
  for (int i = 0; i < n; i++) {
    if (cut[i]) t++;
  }
  cout << t;
}
