#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int64_t> > g[100005];
int n, ans, child[100005];
int64_t a[100005], dp[100005];
void dfs(int u, int pre, int64_t MIN) {
  for (pair<int, int64_t> v : g[u]) {
    if (v.first == pre) continue;
    dp[v.first] = dp[u] + v.second;
    dfs(v.first, u, min(MIN, dp[v.first]));
    child[u] += child[v.first] + 1;
  }
  if (dp[u] - MIN > a[u]) {
    ans += child[u] + 1;
    child[u] = -1;
  }
}
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 u = 2; u <= n; ++u) {
    int v, d;
    cin >> v >> d;
    g[u].push_back(pair<int, int64_t>(v, d));
    g[v].push_back(pair<int, int64_t>(u, d));
  }
  dfs(1, 0, 0);
  cout << ans;
  return 0;
}
