#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
const long double PI = acosl((long double)-1.0);
const long long LINF = ((1ull << 63) - 1ull);
const int MOD = 1000000007;
long long mul(long long a, long long b, long long MOD) { return a * b % MOD; }
long long add(long long a, long long b, long long MOD) {
  int res = a + b;
  if (res >= MOD) {
    res -= MOD;
  }
  return res;
}
long long sub(long long a, long long b, long long MOD) {
  int res = a - b;
  if (res < 0) {
    res += MOD;
  }
  return res;
}
const int MAXN = 100500;
int n, m;
int a[MAXN];
int p[MAXN];
vector<vector<pair<int, int> > > g;
int ans;
void init() {
  scanf("%d", &n);
  g.resize(n + 2);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 2; i <= n; i++) {
    int len;
    scanf("%d%d", &p[i], &len);
    g[p[i]].push_back(pair<int, int>(i, len));
  }
}
void dfs(int v, long long maxdist, bool deleted) {
  if (deleted || maxdist > a[v]) {
    ans++;
    deleted = true;
  }
  for (int i = 0; i < g[v].size(); i++) {
    dfs(g[v][i].first, max(maxdist + g[v][i].second, 0LL), deleted);
  }
}
void solve() {
  init();
  dfs(1, 0LL, false);
  printf("%d\n", ans);
}
void precalc() {}
int main() {
  srand(25);
  precalc();
  int tests = 1;
  for (int i = 1; i <= tests; i++) {
    solve();
  }
  return 0;
}
