#include <bits/stdc++.h>
using namespace std;
long long m, n, k, t;
vector<long long> l, r, d, a;
long long check(long long x) {
  long long mn = (long long)(1e9);
  for (long long i = 0; i < x; i++) mn = min(mn, a[i]);
  vector<pair<long long, long long> > segm;
  for (long long i = 0; i < k; i++) {
    if (d[i] > mn) segm.push_back(make_pair(l[i], r[i]));
  }
  long long tm = 0;
  sort(segm.begin(), segm.end());
  long long prev = 0;
  vector<pair<long long, long long> >::iterator s;
  for (s = segm.begin(); s != segm.end(); s++) {
    if ((*s).first <= prev) {
      tm += max(0LL, (*s).second - prev);
      prev = max((*s).second, prev);
    } else {
      tm += (*s).second - (*s).first + 1;
      prev = (*s).second;
    }
  }
  tm = 2 * tm + n + 1;
  if (tm <= t) return 1;
  return 0;
}
int main() {
  cin >> m >> n >> k >> t;
  a.resize(m);
  for (int i = 0; i < m; i++) cin >> a[i];
  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  l.resize(k);
  r.resize(k);
  d.resize(k);
  for (int i = 0; i < k; i++) cin >> l[i] >> r[i] >> d[i];
  int lo = 0;
  int hi = m + 1;
  while (hi - lo > 1) {
    int mid = (hi + lo) / 2;
    if (check(mid))
      lo = mid;
    else
      hi = mid;
  }
  cout << lo << '\n';
  return 0;
}
