#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 3;
int n, ans = 0;
vector<pair<int, int>> tree[maxn];
vector<int> arr(maxn, 0);
vector<bool> vis(maxn, false);
vector<int> brr(maxn, 0);
vector<int> parent(maxn, 0);
void dfs(int v) {
  if (vis[v]) return;
  vis[v] = true;
  ans++;
  for (int i = 0; i < tree[v].size(); i++) {
    if (parent[v] == tree[v][i].first) continue;
    dfs(tree[v][i].first);
  }
}
void dfs1(int v, int p) {
  parent[v] = p;
  for (int i = 0; i < tree[v].size(); i++) {
    if (tree[v][i].first != p) {
      brr[tree[v][i].first] =
          max(brr[tree[v][i].first], brr[v] + tree[v][i].second);
      dfs1(tree[v][i].first, v);
    }
  }
}
void solve() {
  int p, c;
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i];
  for (int i = 1; i <= n - 1; i++) {
    cin >> p >> c;
    tree[i + 1].push_back({p, c});
    tree[p].push_back({i + 1, c});
  }
  dfs1(1, 0);
  for (int i = 1; i <= n; i++) {
    if (brr[i] > arr[i]) dfs(i);
  }
  cout << ans << "\n";
}
int main() {
  solve();
  return 0;
}
