#include <bits/stdc++.h>
using namespace std;
long long m, n, k, t, lista[500000], mini[400000];
pair<pair<long long, long long>, long long> p[500000];
bool check(long long mid) {
  long long temp = 0;
  long long midmini = mini[mid];
  long long prosli = 0;
  long long najdalji = 0;
  for (int i = 1; i <= k; i++) {
    if (p[i].second > midmini) {
      if (najdalji < p[i].first.second && prosli < p[i].first.first) {
        temp += (p[i].first.second - p[i].first.first + 1) * 2;
        prosli = p[i].first.second;
      } else if (najdalji < p[i].first.second && prosli >= p[i].first.first) {
        temp += (p[i].first.second - prosli) * 2;
        prosli = p[i].first.second;
      }
      najdalji = max(najdalji, p[i].first.second);
    }
  }
  temp += n + 1;
  if (temp > t)
    return false;
  else
    return true;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> m >> n >> k >> t;
  for (int i = 1; i <= m; i++) {
    cin >> lista[i];
  }
  for (int i = 1; i <= k; i++) {
    cin >> p[i].first.first >> p[i].first.second >> p[i].second;
  }
  sort(lista + 1, lista + m + 1);
  reverse(lista + 1, lista + m + 1);
  sort(p + 1, p + 1 + k);
  mini[0] = INT_MAX;
  for (int i = 1; i <= m; i++) {
    mini[i] = min(mini[i - 1], lista[i]);
  }
  long long l = 0;
  long long r = m + 1;
  while (l < r - 1) {
    long long mid = (l + r) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid;
  }
  cout << l;
  return 0;
}
