#include <bits/stdc++.h>
using namespace std;
long long n, m, k, t;
long long a[200005];
long long L[200005];
long long R[200005];
long long D[200005];
long long Cnt[200005];
void Input() {
  scanf("%lld%lld%lld%lld", &m, &n, &k, &t);
  for (int i = 1; i <= m; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 1; i <= k; i++) {
    scanf("%lld%lld%lld", &L[i], &R[i], &D[i]);
  }
}
bool Ok(long long pos) {
  memset(Cnt, 0, sizeof(Cnt));
  long long sobchey_choto = a[pos];
  for (int i = 1; i <= k; i++) {
    if (D[i] > sobchey_choto) {
      Cnt[L[i]]++;
      Cnt[R[i] + 1]--;
    }
  }
  for (int i = 1; i <= n + 1; i++) {
    Cnt[i] += Cnt[i - 1];
  }
  long long last = 0, tot = 0;
  for (int i = 1; i <= n + 1; i++) {
    tot++;
    if (Cnt[i] == 0) {
      if (Cnt[i - 1] != 0) {
        tot += (i - last - 1) * 2;
      }
      last = i;
    }
  }
  if (tot <= t) return 1;
  return 0;
}
long long Fun() {
  long long left = 1, right = m, mid, res = 0;
  while (left <= right) {
    mid = left + (right - left) / 2;
    if (Ok(mid)) {
      res = mid;
      left = mid + 1;
    } else {
      right = mid - 1;
    }
  }
  return res;
}
void Calculation() {
  sort(a + 1, a + 1 + m, greater<long long>());
  long long res = Fun();
  printf("%lld\n", res);
}
void Solve() {
  Input();
  Calculation();
}
int main() {
  long long q;
  q = 1;
  while (q--) Solve();
  return 0;
}
