#include <bits/stdc++.h>
using namespace std;
int n;
int a[100000 + 1];
vector<pair<int, int> > edges[100000 + 1];
int solve(int i, long long int sum, bool rem) {
  int ret = 0;
  if (a[i] < sum) {
    rem = true;
  }
  if (rem) {
    ret++;
  }
  for (int j = 0; j < edges[i].size(); j++) {
    ret += solve(
        edges[i][j].first,
        max(sum + edges[i][j].second, (long long int)edges[i][j].second), rem);
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 2; i < n + 1; i++) {
    int p, c;
    scanf("%d %d", &p, &c);
    edges[p].push_back(make_pair(i, c));
  }
  printf("%d", solve(1, 0LL, false));
  return 0;
}
