#include <bits/stdc++.h>
using namespace std;
const int X = 100000 + 5;
long long A[X], D[X], vis[X];
struct edge {
  long long v, c;
};
vector<edge> E[X];
int res = 1;
void dfs(long long u, long long cc) {
  for (int i = 0; i < (int)E[u].size(); i++) {
    long long c1 = cc;
    long long v = E[u][i].v, c = E[u][i].c;
    if (vis[v]) continue;
    c1 = max(c, c1 + c);
    if (c1 > A[v]) {
    } else {
      res++;
      vis[v] = 1;
      dfs(v, c1);
    }
  }
}
void MAIN() {
  long long n, x, p, c;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i + 1];
  }
  for (int i = 1; i < n; i++) {
    cin >> p >> c;
    E[i + 1].push_back({p, c});
    E[p].push_back({i + 1, c});
  }
  vis[1] = 1;
  dfs(1, -LLONG_MAX / 10LL);
  cout << n - res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(12);
  MAIN();
  return 0;
}
