#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
using namespace std;
struct point {
  long long wh, r, d;
};
long long n, m, k, t;
vector<long long> a;
vector<point> b;
bool check(long long mid) {
  long long mn = 1e9;
  for (long long i = 0; i < mid; i++) mn = min(mn, a[i]);
  long long lr = 0, vr = 0;
  vector<pair<long long, long long> > kek;
  for (long long i = 0; i < k; i++) {
    if (b[i].d > mn) {
      kek.push_back({b[i].wh, b[i].r});
    }
  }
  sort(kek.begin(), kek.end());
  for (auto i : kek) {
    if (i.first <= lr) {
      vr += max(0ll, i.second - lr);
      lr = max(lr, i.second);
    } else {
      vr += i.second - i.first + 1;
      lr = i.second;
    }
  }
  vr = 2 * vr + n + 1;
  return vr <= t;
}
signed main() {
  cin >> m >> n >> k >> t;
  a.resize(m);
  b.resize(k);
  for (long long i = 0; i < m; i++) {
    cin >> a[i];
  }
  sort(a.rbegin(), a.rend());
  for (long long i = 0; i < k; i++) {
    cin >> b[i].wh >> b[i].r >> b[i].d;
  }
  long long l = 0, r = m + 1;
  while (r - l > 1) {
    long long mid = (l + r) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  cout << l << endl;
}
