#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int inf = 0x7f7f7f7f;
const int mod = 1000000007;
long long a[N], b[N];
vector<pair<int, long long> > G[N];
int cnt, ans;
long long min(long long a, long long b) { return a < b ? a : b; }
void dfs(int u, long long num, long long mi, int fa) {
  long long len, num2;
  for (int i = 0; i < G[u].size(); i++) {
    int v = G[u][i].first;
    long long w = G[u][i].second;
    if (v == fa) continue;
    num2 = num + w;
    if ((num2 - mi) > a[v]) continue;
    cnt++;
    dfs(v, num2, min(mi, num2), u);
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cnt = 0, ans = inf;
  int t;
  long long c;
  for (int i = 0; i < n - 1; i++) {
    cin >> t >> c;
    G[i + 1].push_back(make_pair(t - 1, c));
    G[t - 1].push_back(make_pair(i + 1, c));
  }
  cnt = 0;
  dfs(0, 0, 0, 0);
  ans = min(ans, n - cnt - 1);
  cout << ans << endl;
  return 0;
}
