#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int m, n, k, t;
  cin >> m >> n >> k >> t;
  vector<int> agility(m);
  for (int i = 0; i < m; ++i) {
    cin >> agility[i];
  }
  sort(agility.begin(), agility.end(), [](int i, int j) { return i > j; });
  vector<int> loc(k), disarm_loc(k), danger(k);
  for (int i = 0; i < k; ++i) {
    cin >> loc[i] >> disarm_loc[i] >> danger[i];
  }
  int low = 0, high = m;
  while (low < high) {
    int mid = (low + high) / 2 + 1;
    vector<pair<int, int>> traps;
    for (int i = 0; i < k; ++i) {
      if (mid != 0 && danger[i] > agility[mid - 1]) {
        traps.push_back({loc[i] - 1, disarm_loc[i]});
      }
    }
    sort(traps.begin(), traps.end());
    int time = n + 1;
    int cur = 0;
    while (cur < traps.size()) {
      int nex = cur + 1;
      int right = traps[cur].second;
      while (nex < traps.size() && traps[nex].first <= right) {
        right = max(right, traps[nex].second);
        nex++;
      }
      time += 2 * (right - traps[cur].first);
      cur = nex;
    }
    if (time <= t) {
      low = mid;
    } else {
      high = mid - 1;
    }
  }
  cout << high << endl;
  return 0;
}
