#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<int, int> > v[N];
int ct[N], a[N];
int ans = 0;
void dfs(int cur, int par) {
  ct[cur] = 1;
  for (int i = 0; i < v[cur].size(); i++) {
    if (v[cur][i].first != par) {
      dfs(v[cur][i].first, cur);
      ct[cur] += ct[v[cur][i].first];
    }
  }
}
void f(int cur, long long val, int par) {
  for (int i = 0; i < v[cur].size(); i++) {
    if (v[cur][i].first != par) {
      if (val + v[cur][i].second > 1LL * a[v[cur][i].first]) {
        ans += ct[v[cur][i].first];
      } else
        f(v[cur][i].first, max(0LL, val + v[cur][i].second), cur);
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= n - 1; i++) {
    int x, cst;
    scanf("%d%d", &x, &cst);
    v[i + 1].push_back(make_pair(x, cst));
    v[x].push_back(make_pair(i + 1, cst));
  }
  dfs(1, -1);
  f(1, 0, -1);
  cout << ans;
  return 0;
}
