#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int m, n, k, t;
int a[200010];
int loc[200010];
int dd[200010];
int rr[200010];
vector<pair<int, int> > pos2rd[200010];
bool check(int cnt) {
  int low = a[m - cnt];
  int uset = n + 1;
  const int DEFT = 0;
  const int TORM = 1;
  int state = DEFT;
  int tormi = -1;
  int sti = -1;
  for (int i = 0; i < n; i++) {
    for (auto [r, d] : pos2rd[i]) {
      if (state == DEFT) {
        if (d > low) {
          sti = i;
          state = TORM;
          tormi = r;
        }
      } else if (state == TORM) {
        if (d > low) {
          tormi = max(tormi, r);
          continue;
        }
      }
    }
    if (state == TORM) {
      if (i == tormi) {
        uset += 2 * (i - sti + 1);
        state = DEFT;
      }
    }
  }
  return uset <= t;
}
bool sortm(pair<int, int> v1, pair<int, int> v2) {
  auto [r1, d1] = v1;
  auto [r2, d2] = v1;
  if (d1 != d2) {
    return d1 > d2;
  } else {
    return r2 > r1;
  }
}
int main() {
  cin >> m >> n >> k >> t;
  int l = 0, r = m;
  for (int i = 0; i < m; i++) {
    scanf("%d", a + i);
  }
  sort(a, a + m);
  for (int i = 0; i < k; i++) {
    scanf("%d %d %d", loc + i, rr + i, dd + i);
    pos2rd[loc[i] - 1].push_back({rr[i] - 1, dd[i]});
  }
  for (int i = 0; i < n; i++) {
    sort(pos2rd[i].begin(), pos2rd[i].end(), sortm);
  }
  if (check(m)) {
    cout << m << endl;
    return 0;
  }
  while (l + 1 < r) {
    int mid = (l + r) / 2;
    if (check(mid)) {
      l = mid;
    } else {
      r = mid;
    }
  }
  cout << l << endl;
  return 0;
}
