#include <bits/stdc++.h>
using namespace std;
const int maxx = 2e5 + 100;
struct node {
  int l, r, v;
  bool operator<(const node &a) const { return l < a.l; }
} p[maxx];
int a[maxx];
vector<int> q[maxx];
int m, n, k, t;
inline bool check(int kl) {
  if (kl == 0) return 1;
  int mv = a[m - kl + 1];
  long long ans = 0;
  node c[k + 2];
  int cnt = 0;
  for (int i = 1; i <= k; i++)
    if (p[i].v > mv) c[++cnt] = p[i];
  int _max = 0;
  for (int i = 1; i <= cnt; i++) {
    if (c[i].r <= _max) continue;
    _max = max(_max, c[i].l - 1);
    ans += (long long)(c[i].r - _max);
    _max = c[i].r;
  }
  ans = ans * 2ll + n + 1;
  return ans <= (long long)t;
}
int main() {
  scanf("%d%d%d%d", &m, &n, &k, &t);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + m);
  for (int i = 1; i <= k; i++) scanf("%d%d%d", &p[i].l, &p[i].r, &p[i].v);
  sort(p + 1, p + 1 + k);
  int ans = 0;
  int l = 0, r = m;
  while (l <= r) {
    int mid = l + r >> 1;
    if (check(mid)) {
      ans = max(ans, mid);
      l = mid + 1;
    } else
      r = mid - 1;
  }
  cout << ans << endl;
  return 0;
}
