#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int weight;
  size_t end;
};
size_t n;
vector<vector<Edge>> g;
vector<int> allowedDist;
vector<size_t> subtreeSize;
void readInput() {
  cin >> n;
  g.resize(n);
  allowedDist.resize(n);
  subtreeSize.resize(n);
  for (size_t v = 0; v < n; v++) cin >> allowedDist[v];
  for (size_t v = 1; v < n; ++v) {
    size_t parent;
    int weight;
    cin >> parent >> weight;
    --parent;
    Edge e{weight, v};
    g[parent].push_back(e);
  }
}
size_t calcSubtreeSizeDFS(int v) {
  size_t &size = subtreeSize[v] = 1;
  for (const Edge &e : g[v]) size += calcSubtreeSizeDFS(e.end);
  return size;
}
size_t ansDFS(int v, long long maxDist) {
  if (allowedDist[v] < maxDist) return subtreeSize[v];
  size_t ans = 0;
  for (const Edge &e : g[v])
    ans += ansDFS(e.end, std::max(maxDist + e.weight, 0ll));
  return ans;
}
int main() {
  readInput();
  calcSubtreeSizeDFS(0);
  cout << ansDFS(0, 0) << endl;
}
