#include <bits/stdc++.h>
using namespace std;
const int num = 100005;
vector<pair<long long, long long> > adj[num];
long long dis[num], vis[num], vert[num], flag[num], level[num];
long long ans, min1, dist;
void dfs(long long u) {
  vis[u] = 1;
  for (int i = 0; i < adj[u].size(); i++) {
    long long cur = adj[u][i].first;
    if (!vis[cur]) {
      dis[cur] = dis[u] + adj[u][i].second;
      if (dis[cur] - level[u] > vert[cur] or flag[u]) flag[cur] = 1;
      level[cur] = min(level[u], dis[cur]);
      dfs(cur);
    }
  }
  return;
}
int main() {
  long long n, u, v;
  cin >> n;
  for (int i = 1; i < n + 1; i++) cin >> vert[i];
  for (int i = 1; i < n; i++) {
    cin >> u >> v;
    adj[i + 1].push_back(make_pair(u, v));
    adj[u].push_back(make_pair(i + 1, v));
  }
  for (int i = 0; i < adj[1].size(); i++)
    level[adj[1][i].first] = adj[1][i].second;
  dfs(1);
  for (int i = 1; i < n + 1; i++)
    if (flag[i]) ans++;
  cout << ans << "\n";
  return 0;
}
