#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e5 + 5;
const long long INF = (long long)1e18;
int n, a[MAXN], visited[MAXN];
vector<pair<int, int> > g[MAXN];
void dfs1(int from, int par, long long totalDist = 0) {
  visited[from] = true;
  for (int i = 0; i < g[from].size(); i++) {
    int to = g[from][i].first;
    int cost = g[from][i].second;
    if (to != par && totalDist + cost <= a[to]) {
      dfs1(to, from, max(totalDist + cost, 0LL));
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i + 1 < n; i++) {
    int from, to, cost;
    scanf("%d %d", &from, &cost);
    from--;
    to = i + 1;
    g[from].push_back(make_pair(to, cost));
    g[to].push_back(make_pair(from, cost));
  }
  dfs1(0, -1);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (!visited[i]) {
      ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
