#include <bits/stdc++.h>
using namespace std;
int dr[8] = {0, 0, -1, 1, -1, -1, +1, +1};
int dc[8] = {-1, 1, 0, 0, -1, +1, -1, +1};
const int N = 100005;
vector<pair<int, long long>> g[N];
int vis[N], sub[N], ans = 0;
long long val[N], a[N];
int dfs(int v, long long cost) {
  vis[v] = 1;
  int sub = 1;
  for (auto to : g[v]) {
    if (vis[to.first]) continue;
    long long x = max(to.second, cost + to.second);
    if (x <= a[to.first]) sub += dfs(to.first, x);
  }
  return sub;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 2; i <= n; ++i) {
    int x;
    long long w;
    cin >> x >> w;
    g[i].push_back({x, w});
    g[x].push_back({i, w});
  }
  int ans = n - dfs(1, 0);
  cout << ans << endl;
  return 0;
}
