#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 9;
int n;
long long nw[N];
vector<pair<int, long long> > G[N];
int ans = 0;
void dfs(int v, int p, long long d, bool todelete) {
  if (d > nw[v]) todelete = true;
  ;
  if (todelete) ans++;
  for (auto x : G[v]) {
    if (x.first != p) {
      dfs(x.first, v, max(d + x.second, x.second), todelete);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> nw[i];
  }
  long long p, c;
  for (int i = 1; i < n; i++) {
    cin >> p >> c;
    G[i + 1].push_back({p, c});
    G[p].push_back({i + 1, c});
  }
  dfs(1, 0, 0, 0);
  cout << ans << endl;
  return 0;
}
