#include <bits/stdc++.h>
using namespace std;
struct lov {
  long long l, d, r;
};
bool by_l(lov &a, lov &b) {
  if (a.l == b.l) {
    return a.r > b.r;
  }
  return a.l < b.l;
}
bool moshno(long long m, vector<long long> &arr, vector<lov> &p, long long t,
            long long n) {
  queue<lov> q;
  long long mi = arr[m - 1];
  for (int i = 0; i < p.size(); i++) {
    if (p[i].d > mi) q.push(p[i]);
  }
  long long answer = 0;
  long long cur_pos = 0;
  while (!q.empty()) {
    auto cur = q.front();
    q.pop();
    answer += max((cur.l - 1) - cur_pos, 0ll);
    cur_pos = max(cur.l - 1, cur_pos);
    if (cur.d > mi) {
      long long r = cur.r;
      while (!q.empty() && q.front().l <= r) {
        if (q.front().d > mi) {
          r = max(r, q.front().r);
          q.pop();
        } else {
          q.pop();
          break;
        }
      }
      answer += 2 * (r - cur_pos);
    }
  }
  if (cur_pos < n) {
    answer += n - cur_pos;
  }
  return answer <= t;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long m, n, k, t;
  cin >> m >> n >> k >> t;
  n++;
  vector<long long> arr(m);
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
  }
  sort(arr.rbegin(), arr.rend());
  vector<lov> p(k);
  for (int i = 0; i < k; i++) {
    cin >> p[i].l >> p[i].r >> p[i].d;
  }
  sort(p.begin(), p.end(), by_l);
  long long l = 1;
  long long r = m + 1;
  while (r > l) {
    long long c = l + (r - l) / 2;
    if (moshno(c, arr, p, t, n)) {
      l = c + 1;
    } else {
      r = c;
    }
  }
  cout << l - 1;
  return 0;
}
