#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int a[maxn], l[maxn], r[maxn], d[maxn];
int n, m, k, t;
vector<int> adj[maxn];
bool f(int p) {
  long long res = n + 1;
  long long add = 0;
  int c = p == 0 ? 0 : a[p];
  int cur_max = 0;
  for (int i = 1; i <= n; ++i) {
    if (i > cur_max) cur_max = 0;
    for (int v : adj[i]) {
      if (d[v] <= c) continue;
      if (cur_max == 0) {
        cur_max = r[v];
        add += r[v] - i + 1;
        continue;
      }
      if (r[v] > cur_max) {
        add += r[v] - cur_max;
        cur_max = r[v];
      }
    }
  }
  return res + 2 * add <= t;
}
int main() {
  cin >> m >> n >> k >> t;
  for (int i = 1; i <= m; ++i) {
    cin >> a[i];
  }
  for (int i = 0; i < k; ++i) {
    cin >> l[i] >> r[i] >> d[i];
    adj[l[i]].push_back(i);
  }
  sort(a + 1, a + m + 1, greater<int>());
  int lo = 0, hi = m;
  while (lo < hi) {
    int mid = lo + (hi - lo + 1) / 2;
    if (f(mid))
      lo = mid;
    else
      hi = mid - 1;
  }
  cout << lo << endl;
  return 0;
}
