#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005];
vector<int> adj[100005];
map<pair<int, int>, long long> weight;
int vis[100005];
void input();
void dfs(int v, long long maxDistance) {
  vis[v]++;
  if (maxDistance < 0) maxDistance = 0;
  for (int i = 0; i < adj[v].size(); i++) {
    int u = adj[v][i];
    if (vis[u] == 0 && maxDistance + weight[{v, u}] <= a[u]) {
      dfs(u, maxDistance + weight[{v, u}]);
    }
  }
}
void solve() {
  dfs(1, 0);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      ans++;
    }
  }
  cout << ans << "\n";
}
void Clear() {}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  input();
  solve();
  Clear();
}
void input() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 2; i <= n; i++) {
    int p;
    long long c;
    cin >> p >> c;
    adj[i].push_back(p);
    adj[p].push_back(i);
    weight[{i, p}] = c;
    weight[{p, i}] = c;
  }
}
