#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int a[N], l[N], r[N], d[N];
bool cmp(int a, int b) { return a > b; }
int m, n, k, t;
int check(int lim) {
  static int s1[N], s2[N];
  memset(s1, 0, sizeof(s1));
  memset(s2, 0, sizeof(s2));
  for (int i = 1; i <= k; i++)
    if (lim < d[i]) s1[l[i]]++, s2[r[i]]++;
  int now = 0, lst = 0, ans = n + 1;
  for (int i = 1; i <= n; i++) {
    now += s1[i];
    if (!(now - s1[i]) && now) lst = i;
    int tmp = now;
    now -= s2[i];
    if (tmp && (!now)) ans += (i - lst + 1) * 2;
  }
  return ans;
}
int main() {
  scanf("%d%d%d%d", &m, &n, &k, &t);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= k; i++) scanf("%d%d%d", &l[i], &r[i], &d[i]);
  sort(a + 1, a + m + 1, cmp);
  int l = 1, r = m, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(a[mid]) <= t)
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d", ans);
  return 0;
}
