#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v[100010];
int a[100010];
int dfs(int child, int src, long long distance) {
  if (distance > a[child]) {
    return 0;
  }
  int cal = 1;
  for (int i = 0; i < v[child].size(); i++) {
    if (v[child][i].first == src) continue;
    cal +=
        dfs(v[child][i].first, child, max(distance + v[child][i].second, 0ll));
  }
  return cal;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int x, y;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    v[x].push_back(make_pair(i + 1, y));
    v[i + 1].push_back(make_pair(x, y));
  }
  int src = 1;
  int l;
  l = dfs(src, 0, 0);
  printf("%d\n", n - l);
}
