#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vec[100005];
int arr[1000005];
int d[100005], par[100005];
bool vis[100005];
int sub(int x) {
  d[x] = 1;
  vis[x] = true;
  for (int i = 0; i < vec[x].size(); i++) {
    int y = vec[x][i].first;
    if (vis[y]) {
      continue;
    }
    d[x] += sub(y);
  }
  return d[x];
}
long long int dfs(int x, long long int cost) {
  if (cost > arr[x]) {
    return d[x];
  }
  vis[x] = true;
  long long int ret = 0;
  for (int i = 0; i < vec[x].size(); i++) {
    int f = vec[x][i].first;
    int s = vec[x][i].second;
    if (vis[f]) {
      continue;
    }
    ret += dfs(f, max((cost + s), 0LL));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  int q = n;
  q--;
  int i = 1;
  while (q--) {
    int x, y;
    cin >> x >> y;
    vec[i + 1].push_back(make_pair(x, y));
    vec[x].push_back(make_pair(i + 1, y));
    i++;
  }
  sub(1);
  memset(vis, false, sizeof(vis));
  cout << dfs(1, 0) << endl;
  return 0;
}
