#include <bits/stdc++.h>
using namespace std;
const int max_n = 100 * 1000;
int a[max_n];
vector<pair<int, int> > adj[max_n];
bool vis[max_n];
int dfs(int at, long long Max) {
  if (vis[at] || Max > a[at]) return 0;
  vis[at] = true;
  int res = 1;
  for (int i = 0; i < (adj[at].size()); i++)
    res += dfs(adj[at][i].first, max(Max + adj[at][i].second, 0LL));
  return res;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> a[i];
  for (int i = 0; i < (n - 1); i++) {
    int p, w;
    cin >> p >> w;
    p--;
    adj[i + 1].push_back(make_pair(p, w));
    adj[p].push_back(make_pair(i + 1, w));
  }
  memset(vis, 0, sizeof vis);
  cout << n - dfs(0, 0) << endl;
  return 0;
}
