#include <bits/stdc++.h>
using namespace std;
const long long OO = (long long)1e18 + 9;
const int oo = 2147483647;
const double EPS = 1e-9;
const double PI = acos(-1.0);
int dx[] = {-1, 0, 1, 0};
int dy[] = {0, 1, 0, -1};
int dX[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dY[] = {0, 1, 0, -1, 1, 1, -1, -1};
char letters[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                  'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                  's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
int dot(int x, int y, int x2, int y2) { return x * x2 + y * y2; }
long long gcd(long long x, long long y) { return !y ? x : gcd(y, x % y); }
int ord(int r, int c, int nCol) { return (nCol * r) + c + 1; }
int cmpDouble(long double d1, long double d2) {
  return fabs(d1 - d2) <= EPS ? 0 : d1 > d2 ? 1 : -1;
}
vector<vector<pair<int, int> > > adj(100010);
int n;
int cnt = 0, num = 1;
vector<int> vis(100010, 0), a(100010);
void nChilds(int nod, int no) {
  vis[nod] = 1;
  for (int i = 0; i < (int)adj[nod].size(); i++) {
    if (adj[nod][i].first != no && !vis[adj[nod][i].first])
      num++, nChilds(adj[nod][i].first, no);
  }
}
void dfs(int node, int dis) {
  if (dis < 0) dis = 0;
  vis[node] = 1;
  int size = (int)adj[node].size();
  for (int i = 0; i < size; i++) {
    pair<int, int> child = adj[node][i];
    if (!vis[child.first]) {
      if (dis + child.second > a[child.first]) {
        nChilds(child.first, node);
        cnt += num, num = 1;
        continue;
      }
      dfs(child.first, dis + child.second);
    }
  }
}
int main() {
  int u;
  long long c;
  cin >> n;
  for (int i = 1; i < n + 1; i++) cin >> a[i];
  for (int i = 2; i < n + 1; i++)
    scanf("%d", &u), scanf("%I64d", &c), adj[u].push_back(make_pair(i, c)),
        adj[i].push_back(make_pair(u, c));
  dfs(1, 0);
  cout << cnt << endl;
  return 0;
}
