#include <bits/stdc++.h>
using namespace std;
int n;
long long a[100010];
vector<vector<pair<int, long long> > > v;
long long di[100010];
bool vis[100010];
vector<vector<int> > v2;
vector<vector<int> > v3;
vector<int> V;
long long ma[100010];
void dfs(int idx, long long d) {
  if (vis[idx]) return;
  vis[idx] = 1;
  di[idx] = d;
  for (int i = 0; i < v[idx].size(); i++) {
    if (!vis[v[idx][i].first]) {
      v3[v[idx][i].first].push_back(idx);
      v2[idx].push_back(v[idx][i].first);
      dfs(v[idx][i].first, d + v[idx][i].second);
    }
  }
  V.push_back(idx);
}
bool vis2[100010];
int ans = 0;
bool vis4[100010];
long long mm[100010];
int dfs4(int idx) {
  if (vis4[idx]) return mm[idx];
  vis4[idx] = 1;
  int k = 0;
  long long maX = 0, tmp = 0, tmp2 = 0;
  for (int i = 0; i < v3[idx].size(); i++) {
    tmp = di[idx] - di[v3[idx][i]];
    tmp2 = tmp + dfs4(v3[idx][i]);
    if (tmp2 > tmp)
      maX = tmp2, k = ma[v3[idx][i]];
    else
      maX = tmp, k = v3[idx][i];
  }
  ma[idx] = k;
  return mm[idx] = maX;
}
void dfs2(int idx) {
  if (vis2[idx]) return;
  vis2[idx] = 1;
  ans++;
  for (int i = 0; i < v2[idx].size(); i++) dfs2(v2[idx][i]);
}
void check(int idx) {
  if (ma[idx] == -1) return;
  if (di[idx] - di[ma[idx]] > a[idx]) {
    dfs2(idx);
    return;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%I64d", &a[i]);
  v.resize(n + 1);
  v3.resize(n + 1);
  v2.resize(n + 1);
  int p;
  long long c;
  for (int i = 1; i <= n - 1; i++) {
    scanf("%d %I64d", &p, &c);
    v[i + 1].push_back({p, c});
    v[p].push_back({i + 1, c});
  }
  dfs(1, 0);
  di[1] = 0;
  for (int i = 0; i < V.size(); i++) {
    dfs4(V[i]);
    check(V[i]);
  }
  cout << ans;
  return 0;
}
