#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pi = pair<int, int>;
const int mod = 1e9 + 7;
const ll inf = ll(1e18);
const double PI = acos(-1), eps = 1e-9;
const int mxa = 1e4;
const int mxn = 1e5;
int n, a[mxn + 5], p[mxn + 5], cnt;
vector<pi> adj[mxn + 5];
vi r;
bool vis[mxn + 5];
void dfs(int v, ll second = 0) {
  if (second > a[v]) {
    r.push_back(v);
    return;
  }
  for (const auto &p : adj[v]) {
    dfs(p.first, max(second + p.second, p.second * 1ll));
  }
}
void dfsr(int v) {
  vis[v] = 1;
  ++cnt;
  for (const auto &p : adj[v]) {
    if (!vis[p.first]) dfsr(p.first);
  }
}
void solve() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 2; i <= n; ++i) {
    int c;
    cin >> p[i] >> c;
    adj[p[i]].push_back({i, c});
  }
  dfs(1);
  for (const int &x : r) {
    if (!vis[x]) dfsr(x);
  }
  cout << cnt << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  t = 1;
  while (t-- > 0) solve();
}
