#include <bits/stdc++.h>
using namespace std;
const int MAXX = 2e5 + 10;
long long n, a[MAXX], ans;
vector<pair<int, int>> adj[MAXX];
void dfs(long long v, long long dis, long long mn_d) {
  mn_d = min(dis, mn_d);
  if (dis - mn_d > a[v]) return;
  ans++;
  for (auto x : adj[v]) dfs(x.first, dis + x.second, mn_d);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 2; i <= n; i++) {
    int x, w;
    cin >> x >> w;
    adj[x].push_back({i, w});
  }
  dfs(1, 0, 0);
  return cout << n - ans << endl, 0;
}
