#include <bits/stdc++.h>
using namespace std;
int n, k, t, a[200005], maxi[200005];
pair<pair<int, int>, int> p[200005];
vector<pair<pair<int, int>, int> > v;
bool cek(int x) {
  int pos = 0, temp = 0, batas, maxi;
  v.clear();
  for (int i = 0; i < k; i++)
    if (p[i].second > a[x]) v.push_back(p[i]);
  for (int i = 0; i < (int)v.size(); i++) {
    batas = i;
    maxi = v[i].first.second;
    while (batas + 1 < (int)v.size()) {
      if (v[batas + 1].first.first > maxi) break;
      batas++;
      maxi = max(maxi, v[batas].first.second);
    }
    temp += ((3 * maxi) - (2 * (v[i].first.first - 1)) - pos);
    pos = maxi;
    i = batas;
  }
  temp += (n + 1 - pos);
  return (temp <= t);
}
int main() {
  int m, left = 0, right, mid, ans = 0;
  scanf("%d %d %d %d", &m, &n, &k, &t);
  for (int i = 0; i < m; i++) scanf("%d", &a[i]);
  sort(a, a + m);
  reverse(a, a + m);
  for (int i = 0; i < k; i++)
    scanf("%d %d %d", &p[i].first.first, &p[i].first.second, &p[i].second);
  sort(p, p + k);
  right = m - 1;
  while (left <= right) {
    mid = (left + right) / 2;
    if (cek(mid))
      left = ans = mid + 1;
    else
      right = mid - 1;
  }
  printf("%d\n", ans);
  return 0;
}
