#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int64_t mod = 1e9 + 7;
int64_t mod1 = 1e9 + 5;
int64_t power(int64_t a, int64_t b) {
  if (b == 0)
    return 1;
  else if (b % 2 == 0)
    return power((((a % mod) * (a % mod)) % mod), b / 2) % mod;
  else
    return ((a % mod) * (power((((a % mod) * (a % mod)) % mod), b / 2) % mod)) %
           mod;
}
int64_t n, m, k, tim;
int64_t t[800000];
int64_t lazy[800000];
int64_t arr[200001];
vector<int64_t> v;
void push(int64_t id, int64_t l, int64_t r) {
  if (lazy[id]) {
    t[id] = max(t[id], lazy[id]);
    if (l != r) {
      lazy[id << 1] = max(lazy[id << 1], lazy[id]);
      lazy[id << 1 | 1] = max(lazy[id << 1 | 1], lazy[id]);
    }
    lazy[id] = 0;
  }
}
void update(int64_t id, int64_t l, int64_t r, int64_t lq, int64_t rq,
            int64_t val) {
  push(id, l, r);
  if (l > r || lq > r || l > rq) return;
  if (lq <= l && r <= rq) {
    lazy[id] = max(lazy[id], val);
    push(id, l, r);
    return;
  }
  int64_t mid = (l + r) >> 1;
  update(id << 1, l, mid, lq, rq, val);
  update(id << 1 | 1, mid + 1, r, lq, rq, val);
  t[id] = max(t[id << 1], t[id << 1 | 1]);
}
int64_t count(int64_t id, int64_t l, int64_t r, int64_t lq, int64_t rq) {
  push(id, l, r);
  if (l > r || lq > r || l > rq) return 0;
  if (lq <= l && r <= rq) {
    return t[id];
  }
  int64_t mid = (l + r) >> 1;
  return max(count(id << 1, l, mid, lq, rq),
             count(id << 1 | 1, mid + 1, r, lq, rq));
}
bool check(int64_t mini) {
  int64_t st = 0;
  int64_t fi = 0;
  for (int64_t i = 0; i < v.size(); ++i) {
    if (mini < v[i]) {
      fi++;
    } else {
      if (st == i) {
        fi++;
        st = i + 1;
      } else {
        fi += 2 * (i - st);
        fi++;
        st = i + 1;
      }
    }
  }
  return (fi <= tim);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k >> tim;
  memset(t, 0, sizeof(t));
  memset(lazy, 0, sizeof(lazy));
  int64_t a[n];
  for (int64_t i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n, greater<int64_t>());
  for (int64_t i = 0; i < k; ++i) {
    int64_t x, y, z;
    cin >> x >> y >> z;
    update(1, 1, m, x, y, z);
  }
  for (int64_t i = 1; i <= m; ++i) {
    v.push_back(count(1, 1, m, i, i));
  }
  v.push_back(0);
  int64_t lo = 0, hi = n, ans = 0;
  while (lo < hi) {
    int64_t mid = (hi + lo) / 2;
    if (mid == 0) {
      break;
    }
    if (check(a[mid - 1])) {
      lo = mid;
      if (ans == lo) break;
      ans = lo;
    } else {
      hi = mid - 1;
    }
  }
  if (ans != n and check(a[ans])) ans++;
  cout << ans << '\n';
}
