#include <bits/stdc++.h>
using namespace std;
int N;
vector<vector<pair<int, long long> > > children;
vector<int> dist;
int solve(int v, long long maxdist) {
  int result = 0;
  if (maxdist > dist[v]) {
    maxdist = 1ll << 50;
    result++;
  }
  for (auto child : children[v]) {
    result += solve(child.first, max(maxdist, 0ll) + child.second);
  }
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << setprecision(12) << fixed;
  cin >> N;
  children.resize(N);
  dist.resize(N);
  for (int i = (0); i < (N); ++i) cin >> dist[i];
  for (int i = (1); i < (N); ++i) {
    int par, cost;
    cin >> par >> cost;
    par--;
    children[par].push_back(make_pair(i, cost));
  }
  cout << solve(0, 0);
  return 0;
}
