#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
vector<pair<int, int>> adj[N];
int num[N], n, ans;
void dfs(int u = 1, long long cur = 0) {
  ans++;
  for (auto &v : adj[u]) {
    int gg = max(0ll, v.second * 1ll + cur);
    if (gg <= num[v.first]) dfs(v.first, gg);
  }
}
void Suhaib_Sawalha() {
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> num[i];
  for (int i = 2, v, c; i <= n; ++i) {
    cin >> v >> c;
    adj[v].emplace_back(i, c);
  }
  dfs();
  cout << n - ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Suhaib_Sawalha();
  return 0;
}
