#include <bits/stdc++.h>
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
using namespace std;
string to_string(int a) {
  stringstream ss;
  ss << a;
  string s = ss.str();
  return s;
}
long long ans;
vector<pair<int, int> > adj[100005];
long long a[100005];
void dfs(int u, long long dist, int mark, long long mini) {
  mini = min(mini, dist);
  if (dist - mini > a[u]) mark = 1;
  ans += mark;
  for (int i = 0; i < adj[u].size(); ++i) {
    dfs(adj[u][i].first, dist + adj[u][i].second, mark, mini);
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  for (int i = 2; i <= n; ++i) {
    int b, d;
    cin >> b >> d;
    adj[b].push_back(make_pair(i, d));
  }
  dfs(1, 0, 0, 0);
  cout << ans;
  return 0;
}
