#include <bits/stdc++.h>
using namespace std;
int n, a[100003], sub[100003], ans;
long long int dist[100003];
vector<pair<int, int> > adj[100003];
void DFS(int u, int prev, int edge) {
  sub[u] = 1;
  dist[u] = max(dist[prev] + edge, (long long int)edge);
  for (int i = 0; i < adj[u].size(); i++) {
    int v = adj[u][i].first, cost = adj[u][i].second;
    if (v != prev) {
      DFS(v, u, cost);
      sub[u] += sub[v];
    }
  }
  if (dist[u] > (long long int)a[u]) {
    ans += sub[u];
    sub[u] = 0;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i < n; i++) {
    int p, c;
    scanf("%d%d", &p, &c);
    adj[p].push_back(make_pair(i + 1, c));
    adj[i + 1].push_back(make_pair(p, c));
  }
  dist[1] = 0;
  ans = 0;
  DFS(1, 1, 0);
  printf("%d\n", ans);
}
