#include <bits/stdc++.h>
using namespace std;
long long n;
vector<pair<long long, long long> > adj[100007];
long long A[100007];
long long res = 0;
void dfs(int idx = 0, int parent = -1, long long dist = 0) {
  if (dist > A[idx]) return;
  ++res;
  for (int i = 0; i < adj[idx].size(); ++i) {
    int to = adj[idx][i].first;
    if (to != parent) dfs(to, idx, max(dist + adj[idx][i].second, 0LL));
  }
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> A[i];
  for (int i = 1; i < n; ++i) {
    long long x, y;
    cin >> x >> y;
    --x;
    adj[i].push_back({x, y});
    adj[x].push_back({i, y});
  }
  dfs();
  cout << n - res << endl;
  return 0;
}
