#include <bits/stdc++.h>
using namespace std;
int m, n, k, t;
int a[200005];
struct node {
  int l, r, d;
} so[200005];
bool check(int pos) {
  int rmax = 0;
  int lmin = 0;
  int tmp = n + 1;
  for (int i = 1; i <= k; i++) {
    if (so[i].d > pos && !rmax) {
      rmax = so[i].r;
      lmin = so[i].l;
    } else if (so[i].d > pos && so[i].l > rmax &&
               rmax - lmin + 1 + so[i].r - so[i].l + 1 < so[i].r - lmin + 1) {
      tmp += (rmax - lmin + 1) * 2;
      lmin = so[i].l;
      rmax = so[i].r;
    } else if (so[i].d > pos)
      rmax = max(rmax, so[i].r);
  }
  if (rmax == 0) return true;
  tmp += (rmax - lmin + 1) * 2;
  if (tmp <= t) return true;
  return false;
}
bool cmp1(node x, node y) { return x.l < y.l; }
inline int read() {
  int num = 0, w = 0;
  char ch = 0;
  while (!isdigit(ch)) {
    w |= ch == '-';
    ch = getchar();
  }
  while (isdigit(ch)) {
    num = (num << 3) + (num << 1) + (ch ^ 48);
    ch = getchar();
  }
  return w ? -num : num;
}
int main() {
  m = read();
  n = read();
  k = read();
  t = read();
  int l = 0, r = 0, mid, ans = 0x3f3f3f3f;
  for (int i = 1; i <= m; i++) {
    a[i] = read();
    r = max(r, a[i]);
  }
  for (int i = 1; i <= k; i++) {
    so[i].l = read();
    so[i].r = read();
    so[i].d = read();
  }
  sort(so + 1, so + k + 1, cmp1);
  while (l <= r) {
    mid = (l + r) >> 1;
    if (check(mid)) {
      ans = min(ans, mid);
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  if (ans == 0x3f3f3f3f)
    cout << 0;
  else {
    int fin = 0;
    for (int i = 1; i <= m; i++) {
      if (a[i] >= ans) {
        fin++;
      }
    }
    cout << fin << endl;
  }
  return 0;
}
