#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
long long int MOD = 1000000007;
vector<pair<int, long long> > child[100005];
long long cost[100005];
vector<int> a;
int ans = 0;
void dfs(int node, long long acc) {
  if (acc > a[node]) {
    return;
  }
  ans++;
  for (int i = 0; i < child[node].size(); i++) {
    dfs(child[node][i].first, max(acc + child[node][i].second, (long long)0));
  }
}
int main() {
  int n, x;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    a.push_back(x);
  }
  long long co;
  for (int i = 1; i <= n - 1; i++) {
    int y;
    cin >> y;
    y--;
    cin >> co;
    child[y].push_back(make_pair((i), (co)));
  }
  dfs(0, 0);
  printf("%d\n", n - ans);
}
