#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 2e5 + 7;
const long long mod = 998244353;
struct $ {
  int l, r, x;
  bool operator<($ p) const {
    if (l != p.l)
      return l < p.l;
    else if (r != p.r)
      return r > p.r;
    else
      return x < p.x;
  }
} a[N];
int b[N];
map<int, int> mp;
int n, m, k, t;
bool cmp(int x, int y) { return x > y; }
bool check(int x) {
  for (int i = 0; i <= n + 1; ++i) {
    mp[i] = 0;
  }
  for (int i = 0; i < k; ++i) {
    if (a[i].x > x) {
      mp[a[i].l]++;
      mp[a[i].r + 1]--;
    }
  }
  int sum = 0, cnt = 0;
  for (int i = 1; i <= n + 1; ++i) {
    sum += mp[i];
    if (sum)
      cnt += 3;
    else
      cnt++;
  }
  if (cnt > t)
    return false;
  else
    return true;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T = 1;
  while (T--) {
    cin >> m >> n >> k >> t;
    for (int i = 1; i <= m; ++i) {
      cin >> b[i];
    }
    sort(b + 1, b + m + 1, cmp);
    for (int i = 0; i < k; ++i) {
      cin >> a[i].l >> a[i].r >> a[i].x;
    }
    int l = 0, r = m;
    b[0] = inf;
    int ans = 0;
    while (l <= r) {
      int mid = (l + r) >> 1;
      int x = b[mid];
      if (check(x)) {
        ans = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
    cout << ans << endl;
  }
  return 0;
}
