#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x;
  bool d;
  point(long long a = 0, bool b = 0) {
    x = a;
    d = b;
  }
};
long long sqr(long long a) { return ((long long)a) * a; }
bool cmp(long long a, long long b) { return a < b; }
long long bin_pow(long long a, long long k) {
  if (k <= 0) return 1;
  if (k & 1) {
    return (((long long)a) * bin_pow(a, k - 1)) % 1000000007;
  } else {
    return sqr(bin_pow(a, (k >> 1))) % 1000000007;
  }
}
vector<bool> used(100100, false);
vector<bool> del(100100, false);
vector<int> a(100100);
vector<vector<long long> > v(100100);
vector<vector<long long> > f(100100);
int ans = 0;
void dfs(int k, int max) {
  used[k] = true;
  if (a[k] < max) {
    return;
  }
  ans++;
  if (max < 0) max = 0;
  for (int i = 0; i < v[k].size(); i++)
    if (!used[v[k][i]]) {
      dfs(v[k][i], max + f[k][i]);
    }
}
int main() {
  int n, m, max = -1;
  int tmp, tmp2;
  scanf("%d", &tmp);
  n = tmp;
  for (int i = 0; i < n; i++) {
    scanf("%d ", &a[i]);
  }
  for (long long i = 1; i < n; i++) {
    scanf("%d %d", &tmp, &tmp2);
    tmp--;
    v[i].push_back(tmp);
    f[i].push_back(tmp2);
    v[tmp].push_back(i);
    f[tmp].push_back(tmp2);
  }
  dfs(0, 0);
  printf("%d\n", n - ans);
  return 0;
}
