#include <bits/stdc++.h>
using namespace std;
const int N = 123456;
vector<pair<int, long long int> > edges[N];
int treeSize[N];
long long int num[N];
int dfs1(int i) {
  int size = 1;
  for (int j = 0; j < edges[i].size(); j++) {
    size += dfs1(edges[i][j].first);
  }
  return treeSize[i] = size;
}
int dfs2(int i, long long int sum) {
  if (num[i] < sum) {
    return treeSize[i];
  }
  int ret = 0;
  for (int j = 0; j < edges[i].size(); j++) {
    ret += dfs2(edges[i][j].first, max(0ll, sum + edges[i][j].second));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> num[i];
  }
  for (int i = 2; i <= n; i++) {
    int tar;
    long long int val;
    cin >> tar >> val;
    edges[tar].push_back(make_pair(i, val));
  }
  dfs1(1);
  cout << dfs2(1, 0) << '\n';
}
