#include <bits/stdc++.h>
using namespace std;
const int L = 1e5 + 7;
long long a[L];
int siz[L], ans = 0;
std::vector<pair<int, long long> > v[L];
void dfs(int vertex, int parent, int mxsofar) {
  long long tmp;
  for (auto &x : v[vertex]) {
    if (x.first != parent) {
      tmp = max(mxsofar + x.second, x.second);
      if (tmp > a[x.first])
        ans += siz[x.first];
      else
        dfs(x.first, vertex, tmp);
    }
  }
  return;
}
int fix(int vertex, int parent) {
  siz[vertex] = 1;
  for (auto &x : v[vertex])
    if (x.first != parent) siz[vertex] += fix(x.first, vertex);
  return siz[vertex];
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int aa, n;
  long long bb;
  cin >> n;
  for (int i = 1; i < n + 1; ++i) cin >> a[i];
  for (int i = 2; i < n + 1; ++i) {
    cin >> aa >> bb;
    v[aa].push_back(make_pair(i, bb));
    v[i].push_back(make_pair(aa, bb));
  }
  fix(1, -1);
  dfs(1, -1, 0);
  cout << ans;
  return 0;
}
