#include <bits/stdc++.h>
using namespace std;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const long double EPS = 1e-9;
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline double my_sqrt(T n) {
  double high = n, low = 0, mid, ans;
  int cnt = 100;
  while (cnt--) {
    mid = low + (high - low) / 2;
    if (mid * mid <= n)
      ans = mid, low = mid;
    else
      high = mid;
  }
  return ans;
}
template <class T>
inline T bigmod(T b, T p) {
  if (p <= 0 || b == 0) return 1;
  if (p & 1) return (b * bigmod(b, p - 1)) % MOD;
  long long x = bigmod(b, p >> 1);
  return (x * x) % MOD;
}
const int maxn = 2e5;
int freq[maxn + 5], n, m, k, t;
int f(int mxvalue, int t, std::vector<pair<int, int> > &trapl,
      std::vector<pair<int, int> > &trapr) {
  int pos = 0, x = 0, y = 0, have = 0;
  trapl.push_back({inf, 0});
  trapr.push_back({inf, 0});
  for (int i = 1; i <= n + 1; i++) {
    t--;
    if (!have && (trapl[x].first > i)) {
      pos = i;
    }
    while (trapl[x].first <= i) {
      if (trapl[x].second > mxvalue) have++;
      x++;
    }
    if (!have) pos = i;
    while (trapr[y].first <= i) {
      if (trapr[y].second > mxvalue) have--;
      y++;
    }
    if (!have) {
      t -= (i - pos) * 2;
      pos = i;
    }
  }
  if (t >= 0 && !have && pos == n + 1) return 1;
  return 0;
}
void solve() {
  scanf("%d%d", &m, &n);
  scanf("%d%d", &k, &t);
  std::vector<int> solder(m);
  std::vector<pair<int, int> > trapl(k), trapr(k);
  memset(freq, 0, sizeof freq);
  solder.push_back(0);
  for (int i = 0; i < m; i++) {
    scanf("%d", &solder[i]);
  }
  sort((solder).begin(), (solder).end());
  for (int i = 0; i < k; i++) {
    int l, r, c;
    scanf("%d%d%d", &l, &r, &c);
    trapl[i] = {l, c};
    trapr[i] = {r, c};
  }
  sort((trapl).begin(), (trapl).end());
  sort((trapr).begin(), (trapr).end());
  int low = 1, high = m, mid, res = 0;
  while (low <= high) {
    mid = low + (high - low) / 2;
    if (f(solder[m - mid + 1], t, trapl, trapr)) {
      res = mid;
      low = mid + 1;
    } else
      high = mid - 1;
  }
  printf("%d\n", res);
}
int main() {
  int test = 1;
  while (test--) {
    solve();
  }
  return 0;
}
