#include <bits/stdc++.h>
using namespace std;
struct __s {
  __s() {
    srand(time(NULL));
    if (1) {
      ios_base::Init i;
      cin.sync_with_stdio(0);
      cin.tie(0);
    }
  }
  ~__s() {
    if (!1)
      fprintf(stderr, "Execution time: %.3lf s.\n",
              (double)clock() / CLOCKS_PER_SEC);
    long long n;
    cin >> n;
  }
} __S;
long long a[111111];
vector<pair<long long, long long> > g[111111];
bool u[111111];
long long ans;
void dfs(long long i, long long c = 0) {
  c = max(c, 0LL);
  u[i] = true;
  ans++;
  for (long long jj = 0; jj < (long long)(g[i].size()); jj++) {
    long long j = g[i][jj].first;
    long long p = g[i][jj].second;
    if (u[j]) continue;
    if (c + p > a[j]) continue;
    dfs(j, c + p);
  }
}
int main(void) {
  long long n;
  cin >> n;
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < (long long)(n - 1); i++) {
    long long p, c;
    cin >> p >> c;
    p--;
    g[i + 1].push_back(make_pair(p, c));
    g[p].push_back(make_pair(i + 1, c));
  }
  dfs(0);
  cout << n - ans << '\n';
  return 0;
}
