#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int m, n, k, t, a[N], l[N], r[N], d[N];
bool ok(int first) {
  int tt = n + 1;
  vector<pair<int, int>> ss;
  for (int i = 0; i < k; i++) {
    if (d[i] > a[m - first]) {
      ss.push_back({l[i], r[i]});
    }
  }
  sort((ss).begin(), (ss).end());
  pair<int, int> c = {0, 0};
  for (auto s : ss) {
    if (s.first > c.second) {
      tt += 2 * (c.second - c.first);
      c = s;
    } else {
      c.first = min(c.first, s.first);
      c.second = max(c.second, s.second);
    }
  }
  tt += 2 * (c.second - c.first);
  return tt <= t;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> m >> n >> k >> t;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  sort(a, a + m);
  for (int i = 0; i < k; i++) {
    cin >> l[i] >> r[i] >> d[i];
    l[i]--;
  }
  int lo = 0, hi = m + 1;
  while (hi - lo > 1) {
    int mi = (lo + hi) / 2;
    if (ok(mi)) {
      lo = mi;
    } else {
      hi = mi;
    }
  }
  cout << lo << '\n';
  return 0;
}
