#include <bits/stdc++.h>
using namespace std;
int m, n, k, t;
vector<int> sol, l, r, d;
bool pass(long long int x) {
  int mn = INT_MAX;
  for (auto i = 0; i < x; ++i) {
    mn = min(mn, sol.at(i));
  }
  vector<pair<int, int> > segment;
  for (auto i = 0; i < k; ++i) {
    if (d.at(i) > mn) {
      segment.push_back(make_pair(l.at(i), r.at(i)));
    }
  }
  sort(segment.begin(), segment.end());
  int time_{};
  int last_pos{};
  for (auto &[left, right] : segment) {
    if (left <= last_pos) {
      time_ += max(0, right - last_pos);
      last_pos = max(right, last_pos);
    } else {
      time_ += right - left + 1;
      last_pos = right;
    }
  }
  time_ = 2 * time_ + n + 1;
  return time_ <= t;
}
auto SOLUTION_FUNCTION(void) -> void {
  cin >> m >> n >> k >> t;
  sol.resize(m);
  l.resize(k);
  r.resize(k);
  d.resize(k);
  for (auto &i : sol) {
    cin >> i;
  };
  sort(sol.begin(), sol.end(), greater<long long int>());
  for (auto i = 0; i < k; ++i) {
    cin >> l.at(i) >> r.at(i) >> d.at(i);
  }
  int ans{}, left{}, right = m + 1;
  while (right - left > 1) {
    int mid = (left + right) / 2;
    if (pass(mid)) {
      left = mid;
    } else {
      right = mid;
    }
  }
  cout << left << '\n';
  return;
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout << setprecision(10);
  cout << fixed;
  cout << boolalpha;
  int testcase = 1;
  while (testcase--) {
    SOLUTION_FUNCTION();
  }
  return 0;
}
