#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const int INF = 0x3f3f3f3f;
int n;
int a[N];
int ecnt, head[N];
struct Edge {
  int to, next;
  long long w;
} e[N * 2];
int cnt;
void AddEdge(int u, int v, long long w) {
  e[++ecnt].to = v;
  e[ecnt].next = head[u];
  e[ecnt].w = w;
  head[u] = ecnt;
}
void DFS(int u, int pre, long long w) {
  if (a[u] < w) return;
  cnt++;
  for (int i = head[u]; i; i = e[i].next) {
    int v = e[i].to;
    if (v != pre) DFS(v, u, max(0LL, w + e[i].w));
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 2; i <= n; i++) {
    int v, w;
    scanf("%d%lld", &v, &w);
    AddEdge(i, v, w);
    AddEdge(v, i, w);
  }
  DFS(1, 1, 0);
  printf("%d\n", n - cnt);
  return 0;
}
