#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 10;
int n[MAXN];
struct node {
  int r;
  int d;
  bool friend operator<(const node &a, const node &b) { return a.d > b.d; }
};
vector<node> m[MAXN];
int N, len, M, T;
bool check(int min_n) {
  int dp = 0;
  int pre_r = 0;
  for (int i = 1; i <= len; ++i) {
    int r = i - 1;
    for (int j = 0; j < m[i].size(); ++j) {
      if (m[i][j].d <= min_n) break;
      r = max(r, m[i][j].r);
    }
    if (r > i - 1) {
      int ans1, ans2;
      ans1 = 2 * (r - (i - 1));
      ans2 = max(0, 2 * (r - pre_r));
      dp += min(ans1, ans2);
      pre_r = max(pre_r, r);
    }
    if (dp > T) return false;
  }
  if (dp > T) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> len >> M >> T;
  T -= (len + 1);
  for (int i = 1; i <= N; ++i) cin >> n[i];
  sort(n + 1, n + 1 + N, greater<int>());
  for (int i = 1; i <= M; ++i) {
    int l, r, d;
    cin >> l >> r >> d;
    m[l].push_back({r, d});
  }
  for (int i = 1; i <= len; ++i) sort(m[i].begin(), m[i].end());
  int l = 0, r = N + 1;
  int mid;
  n[0] = 0x3f3f3f3f;
  n[N + 1] = -1;
  while (r - l > 1) {
    mid = (l + r) / 2;
    if (check(n[mid]))
      l = mid;
    else
      r = mid;
  }
  cout << l << endl;
  return 0;
}
