#include <bits/stdc++.h>
using namespace std;
template <class T>
bool ckmin(T& a, const T& b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
template <typename T>
inline void read(T& x) {
  x = 0;
  T fg = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') fg = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  x = fg * x;
}
template <typename T, typename... Args>
inline void read(T& x, Args&... args) {
  read(x), read(args...);
}
template <typename T>
inline void write(T x) {
  int len = 0;
  char c[21];
  if (x < 0) putchar('-'), x = -x;
  do {
    ++len;
    c[len] = x % 10 + '0';
  } while (x /= 10);
  for (int i = len; i >= 1; i--) putchar(c[i]);
}
template <typename T, typename... Args>
inline void write(T x, Args... args) {
  write(x), write(args...);
}
long long a[200005];
long long m, n, k, t;
struct Node {
  long long l, r, d;
  bool operator<(const Node& x) const {
    if (l == x.l) {
      if (r == x.r) return d < x.d;
      return r < x.r;
    }
    return l < x.l;
  }
} ns[200005];
bool check(long long tmpa) {
  long long sumt = n + 1;
  long long prepos = 0, pos = 0;
  for (int i = 1; i <= k; i++) {
    if (ns[i].d > tmpa) {
      prepos = ns[i].l - 1;
      pos = ns[i].r;
      bool fg = false;
      while (i <= k && ns[i].l <= pos) {
        fg = true;
        if (ns[i].d > tmpa) {
          pos = max(pos, ns[i].r);
        }
        i++;
      }
      if (fg) i--;
      sumt += 2 * (pos - prepos);
    }
    if (sumt > t) {
      break;
    }
  }
  return sumt <= t;
}
int main() {
  read(m, n, k, t);
  for (int i = 1; i <= m; i++) read(a[i]);
  for (int i = 1; i <= k; i++) {
    read(ns[i].l, ns[i].r, ns[i].d);
  }
  a[0] = 0x3f3f3f3f;
  sort(a + 1, a + 1 + m, greater<long long>());
  sort(ns + 1, ns + 1 + k);
  long long el = 0, er = m;
  long long ans = 0;
  while (el <= er) {
    long long mid = (el + er) >> 1;
    if (check(a[mid])) {
      ans = mid;
      el = mid + 1;
    } else
      er = mid - 1;
  }
  cout << ans << '\n';
  return 0;
}
