#include <bits/stdc++.h>
using namespace std;
long long m, n, k, t;
vector<long long> a(200001), l(200001), r(200001), d(200001);
bool check(long long x) {
  x = a[x];
  vector<pair<long long, long long>> p;
  for (long long i = 0; i < k; i++) {
    if (d[i] > x) {
      p.emplace_back(l[i], r[i]);
    }
  }
  sort(p.begin(), p.end());
  long long pt = 0, tot = 0;
  for (long long i = 0; i < p.size(); i++) {
    if (p[i].second > pt) {
      if (pt < p[i].first) pt = p[i].first - 1;
      tot += p[i].second - pt;
      pt = p[i].second;
    }
  }
  return n + 1 + tot * 2 <= t;
}
void solve() {
  cin >> m >> n >> k >> t;
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i < k; i++) {
    cin >> l[i] >> r[i] >> d[i];
  }
  sort(a.begin(), a.end(), greater<long long>());
  long long st = 0, en = m - 1;
  long long res = -1;
  while (st <= en) {
    long long mid = st + en >> 1;
    if (check(mid)) {
      st = mid + 1;
      res = mid;
    } else {
      en = mid - 1;
    }
  }
  cout << res + 1 << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
}
