#include <bits/stdc++.h>
using namespace std;
int m, n, k, t;
int a[200007];
int x[200007], y[200007], z[200007];
int sum[200007];
int check(int v) {
  memset(sum, 0, sizeof(sum));
  for (int i = 1; i <= k; ++i)
    if (z[i] > v) ++sum[x[i]], --sum[y[i] + 1];
  int temp = 0;
  for (int i = 1; i <= n; ++i) {
    sum[i] += sum[i - 1];
    if (sum[i]) temp += 2;
  }
  if (temp <= t) return 1;
  return 0;
}
int main() {
  cin >> m >> n >> k >> t;
  for (int i = 1; i <= m; ++i) cin >> a[i];
  for (int i = 1; i <= k; ++i) cin >> x[i] >> y[i] >> z[i];
  t -= n + 1;
  sort(a + 1, a + 1 + m);
  int l = 0, r = m;
  int ans = 0;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    if (check(a[m - mid + 1])) {
      l = mid;
      ans = max(ans, mid);
    } else
      r = mid - 1;
  }
  cout << ans;
  return 0;
}
