#include <bits/stdc++.h>
using namespace std;
const long long int N = 1e5 + 5;
const long long int INF = 1e18;
const long long int mod = 1e9 + 7;
vector<pair<long long int, long long int> > g[N];
long long int n, u, v, a[N], dis[N], maxi[N], mark[N];
void DFS(long long int cur, long long int par) {
  for (long long int i = 0; i < g[cur].size(); i++) {
    if (g[cur][i].first == par) {
      continue;
    }
    dis[g[cur][i].first] = dis[cur] + g[cur][i].second;
    maxi[g[cur][i].first] = min(dis[g[cur][i].first], maxi[cur]);
    DFS(g[cur][i].first, cur);
  }
}
void DFSX(long long int cur, long long int par) {
  for (long long int i = 0; i < g[cur].size(); i++) {
    if (g[cur][i].first == par) {
      continue;
    }
    if (dis[g[cur][i].first] - maxi[g[cur][i].first] > a[g[cur][i].first] ||
        mark[cur] == -1) {
      mark[g[cur][i].first] = -1;
    }
    DFSX(g[cur][i].first, cur);
  }
}
void MaiN() {
  cin >> n;
  for (long long int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long int i = 1; i < n; i++) {
    cin >> u >> v;
    g[i + 1].push_back(make_pair(u, v));
    g[u].push_back(make_pair(i + 1, v));
  }
  DFS(1, 0);
  DFSX(1, 0);
  long long int cnt = 0;
  for (long long int i = 1; i <= n; i++) {
    if (mark[i] == -1) {
      cnt++;
    }
  }
  cout << cnt << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int t = 1;
  while (t--) {
    MaiN();
  }
}
