#include <bits/stdc++.h>
using namespace std;
struct edge {
  int vertex, cost;
};
vector<list<edge>> ADJLST;
vector<int> heights, Number;
int calHeight(int ind, int par = 0) {
  heights[ind] = 1;
  for (list<edge>::iterator itr = ADJLST[ind].begin(); itr != ADJLST[ind].end();
       itr++) {
    if (itr->vertex != par) heights[ind] += calHeight(itr->vertex, ind);
  }
  return heights[ind];
}
int calMin(int ind, int edgeLen = 0, int par = 0) {
  if (edgeLen > Number[ind])
    return heights[ind];
  else {
    int vert = 0;
    for (list<edge>::iterator itr = ADJLST[ind].begin();
         itr != ADJLST[ind].end(); itr++) {
      if (itr->vertex != par)
        vert += calMin(itr->vertex, max(itr->cost, itr->cost + edgeLen), ind);
    }
    return vert;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  Number = vector<int>(n + 1);
  for (int i = 1; i <= n; ++i) cin >> Number[i];
  ADJLST = vector<list<edge>>(n + 1);
  heights = vector<int>(n + 1, 0);
  for (int i = 2; i <= n; ++i) {
    edge e;
    cin >> e.vertex >> e.cost;
    ADJLST[i].push_back(e);
    ADJLST[e.vertex].push_back({i, e.cost});
  }
  calHeight(1);
  cout << calMin(1) << "\n";
}
