#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 2e5 + 5;
int m, n, k, t;
int l, r, d;
int a[MAXN];
vector<pair<pair<int, int>, int> > v;
bool check(int x) {
  int nowt = 0;
  int lastst = 1, lasten = 0;
  for (auto &it : v) {
    if (it.second <= a[x]) continue;
    if (it.first.first > lasten) {
      nowt += (lasten - lastst + 1) * 3;
      nowt += it.first.first - lasten - 1;
      lastst = it.first.first;
      lasten = it.first.second;
    }
    lasten = max(lasten, it.first.second);
  }
  return nowt <= t;
}
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 >> l >> r >> d;
    v.push_back(pair<pair<int, int>, int>(pair<int, int>(l, r), d));
  }
  sort(a + 1, a + m + 1, greater<int>());
  v.push_back(
      pair<pair<int, int>, int>(pair<int, int>(n + 2, n + 1), a[1] + 1));
  sort(v.begin(), v.end());
  int st = 1, en = m, mid = 0, ans = 0;
  while (st <= en) {
    mid = (st + en) / 2;
    if (check(mid)) {
      ans = mid;
      st = mid + 1;
    } else {
      en = mid - 1;
    }
  }
  cout << ans << endl;
  return 0;
}
