#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
const int N = 2e5 + 10;
template <typename T>
istream &operator>>(istream &is, vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++) is >> *i;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for (auto i = begin(v); i != end(v); i++)
    os << *i << (i == end(v) - 1 ? "\n" : " ");
  return os;
}
int a[N];
struct IN {
  int l, r, d;
} b[N];
int main() {
  int n, k, m, t;
  cin >> n >> k >> m >> t;
  for (int i = 1, ilen = (int)(n); i <= ilen; ++i) cin >> a[i];
  sort(a + 1, a + 1 + n);
  for (int i = 1, ilen = (int)(m); i <= ilen; ++i)
    cin >> b[i].l >> b[i].r >> b[i].d;
  sort(b + 1, b + 1 + m, [](IN aa, IN bb) { return aa.l < bb.l; });
  int ans = 0;
  int l = 1, r = n;
  while (l <= r) {
    int mid = (l + r) >> 1;
    int mn = a[n - mid + 1];
    int lst = 0;
    int sum = 0;
    for (int i = 1, ilen = (int)(m); i <= ilen; ++i) {
      if (b[i].r <= lst || b[i].d <= mn) continue;
      if (lst < b[i].l) lst = b[i].l - 1;
      sum += b[i].r - lst;
      lst = b[i].r;
    }
    ll cnt = 2ll * sum + k + 1;
    if (cnt <= t)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  cout << ans << endl;
  return 0;
}
