#include <bits/stdc++.h>
using namespace std;
const long long INF = -1e15;
const long long MAXn = 1e5 + 100;
long long c[MAXn], a[MAXn];
long long n, cnt, v;
vector<pair<long long, long long> > T[MAXn];
void dfs(long long v, long long dist, long long mx) {
  if (mx > a[v] - dist) return;
  mx = max(mx, -dist);
  cnt++;
  for (auto u : T[v]) dfs(u.first, dist + u.second, mx);
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  cin >> n;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  for (long long i = 1; i <= n - 1; ++i) {
    cin >> v >> c[i];
    v--;
    T[v].push_back(make_pair(i, c[i]));
  }
  dfs(0, 0, INF);
  return cout << n - cnt << endl, 0;
}
