#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e18, M = 1e9 + 7;
const long long int N = 1;
void solve() {
  long long int m, n, k, t;
  cin >> m >> n >> k >> t;
  vector<long long int> val(m);
  for (long long int i = 0; i < m; ++i) cin >> val[i];
  sort(val.begin(), val.end());
  reverse(val.begin(), val.end());
  vector<pair<long long int, pair<long long int, long long int>>> traps(k);
  long long int a, b, c;
  for (long long int i = 0; i < k; ++i) {
    cin >> a >> b >> c;
    traps.push_back({a, {b, c}});
  }
  sort(traps.begin(), traps.end());
  long long int beg = 1, en = m;
  long long int mid, ans = 0;
  long long int now, cur;
  while (beg <= en) {
    mid = (beg + en) / 2;
    now = 0;
    cur = n + 1;
    for (auto c : traps) {
      if (c.second.second > val[mid - 1] && now < c.second.first) {
        cur += 2 * (c.second.first - max(c.first - 1, now));
        now = c.second.first;
      }
    }
    if (cur <= t) {
      ans = mid;
      beg = mid + 1;
    } else
      en = mid - 1;
  }
  cout << ans;
}
int32_t main() {
  long long int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
