#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX;
const long long INFL = LLONG_MAX;
const long double pi = acos(-1);
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
long long a[100000 + 1];
vector<pair<int, long long> > g[100000 + 1];
int ans;
void dfs(int v, int p, long long sum) {
  if (sum > a[v]) {
    return;
  }
  ans--;
  for (vector<pair<int, long long> >::iterator it = g[v].begin();
       it != g[v].end(); it++)
    if (it->first != p) dfs(it->first, v, max(sum + it->second, it->second));
}
int main() {
  ios_base::sync_with_stdio(0);
  cout.precision(15);
  cout << fixed;
  cout.tie(0);
  cin.tie(0);
  int n;
  cin >> n;
  ans = n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n - 1; i++) {
    int to, from;
    long long cost;
    from = i + 1;
    cin >> to >> cost;
    g[from].push_back(make_pair(to, cost));
    g[to].push_back(make_pair(from, cost));
  }
  dfs(1, -1, 0);
  cout << ans << '\n';
  return 0;
}
