#include <bits/stdc++.h>
using namespace std;
int m, n, k, t;
struct node {
  int l, r, d;
  node(int lll = 0, int rr = 0, int dd = 0) : l(lll), r(rr), d(dd) {}
} p[200010];
int a[200010], d[200010];
bool cmp(int a, int b) { return a > b; }
bool check(int x) {
  int mn = a[x], pre = 2e5 + 10;
  for (int i = 1; i <= n + 1; i++) d[i] = 0;
  for (int i = 1; i <= k; i++) {
    if (p[i].d <= mn) continue;
    d[p[i].l]++;
    d[p[i].r + 1]--;
    pre = min(p[i].l - 1, pre);
  }
  int ans = 0;
  for (int i = 1; i <= n + 1; i++) {
    if (d[i - 1] && d[i] + d[i - 1] == 0) {
      ans += (i - pre) * 3;
    } else if (d[i - 1] == 0 && d[i] + d[i - 1]) {
      pre = i;
      ans++;
    } else if (d[i - 1] == 0 && d[i] + d[i - 1] == 0)
      ans++;
    d[i] += d[i - 1];
  }
  if (ans <= t) return true;
  return false;
}
int main() {
  cin >> m >> n >> k >> t;
  for (int i = 1; i <= m; i++) {
    scanf("%d", &a[i]);
  }
  a[0] = 2e5 + 10;
  sort(a + 1, a + 1 + m, cmp);
  for (int i = 1; i <= k; i++) {
    scanf("%d%d%d", &p[i].l, &p[i].r, &p[i].d);
  }
  int l = 0, r = m;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (check(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d\n", l - 1);
}
