#include <bits/stdc++.h>
using namespace std;
const int inf = 1000000000;
const long long INF = 1LL * inf * inf;
const double eps = 1e-9;
const int MAXN = 2500;
const int md = (int)1e9;
const double EPS = 1e-5;
template <typename name>
inline name sqr(name x) {
  return x * x;
}
template <typename name>
inline name bpow(name base, int exp, long long md = (1 << 63)) {
  if (exp == 0) return 1;
  if (exp % 2 == 1)
    return (base * bpow(base, exp - 1, md)) % md;
  else {
    name k = bpow(base, exp / 2, md);
    return (k * k) % md;
  }
}
int n, a[200000], ans, use[200000];
vector<pair<int, long long> > way[200000];
void dfs(int x, long long mx, int flag) {
  if (use[x]) return;
  mx = max(mx, 0ll);
  if (mx > a[x] || flag) ans++, flag = 1;
  use[x] = 1;
  for (int i = 0; i < way[x].size(); i++) {
    int to = way[x][i].first;
    long long cost = way[x][i].second;
    dfs(to, mx + cost, flag);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 2; i <= n; i++) {
    int x, c;
    cin >> x >> c;
    way[x].push_back(make_pair(i, c));
    way[i].push_back(make_pair(x, c));
  }
  dfs(1, 0, 0);
  cout << ans;
  return 0;
}
