#include <bits/stdc++.h>
using namespace std;
int mn[200005], a[200005];
pair<pair<int, int>, int> trap[200005];
int m, n, k, t;
int ok(int id) {
  int agi = a[m - id + 1];
  int res = 0, vt = 0;
  for (int i = 1; i <= k; ++i) {
    int x = trap[i].second;
    int l = trap[i].first.first;
    int r = trap[i].first.second;
    if (agi >= x || r <= vt) continue;
    if (vt < l) vt = l - 1;
    int d = r - vt;
    res += d;
    vt = r;
  }
  return ((2 * res + n + 1) <= t);
}
int main() {
  scanf("%d %d", &m, &n);
  scanf("%d %d", &k, &t);
  for (int i = 1; i <= m; ++i) scanf("%d", &a[i]);
  sort(a + 1, a + m + 1);
  for (int i = 1; i <= k; ++i) {
    int l, r, d;
    scanf("%d %d", &l, &r);
    scanf("%d", &d);
    trap[i].first = make_pair(l, r);
    trap[i].second = d;
  }
  sort(trap + 1, trap + k + 1);
  int l = 1, r = m;
  int ans = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (ok(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  printf("%d\n", ans);
  return 0;
}
