#include <bits/stdc++.h>
long long int gcd(long long int a, long long int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long int exp(long long int x, long long int y, long long int mod) {
  long long int res = 1;
  x = x % mod;
  while (y > 0) {
    if (y & 1) res = (res * x) % mod;
    y = y >> 1;
    x = (x * x) % mod;
  }
  return res;
}
long long int modinverse(long long int x, long long int mod) {
  return exp(x, mod - 2, mod);
}
using namespace std;
const long long int inf = 0x3f3f3f3f3f3f3f3fll;
long long int n, x, w, ans;
vector<pair<long long int, long long int> > g[100001];
vector<long long int> val(100001), maxval(100001), vis(100001), sad(100001);
void dfs(long long int v) {
  vis[v] = 1;
  for (long long int i = 0; i < g[v].size(); i++) {
    long long int to = g[v][i].first;
    long long int w = g[v][i].second;
    if (!vis[to]) {
      maxval[to] = max(maxval[v] + w, (long long int)0);
      if ((maxval[to] > val[to]) || (sad[v])) sad[to] = 1;
      dfs(to);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  cin >> n;
  for (long long int i = 1; i < n + 1; i++) cin >> val[i];
  for (long long int i = 2; i < n + 1; i++) {
    cin >> x >> w;
    g[i].push_back(make_pair(x, w));
    g[x].push_back(make_pair(i, w));
  }
  dfs(1);
  for (long long int i = 1; i < n + 1; i++) {
    if (sad[i]) ans++;
  }
  cout << ans;
  return 0;
}
