#include <bits/stdc++.h>
using namespace std;
struct Trap {
  int l, d, r;
  bool operator<(const Trap &alt) const { return l < alt.l; }
};
vector<int> agility;
vector<Trap> traps;
int n, m, k, t;
int get_time(int p) {
  int l = -1;
  int r = -1;
  int res = n + 1;
  for (auto i : traps)
    if (i.d > p) {
      if (i.l <= r)
        r = max(r, i.r);
      else {
        if (r != -1) res += 2 * (r - l + 1);
        l = i.l;
        r = i.r;
      }
    }
  if (r >= 0) res += 2 * (r - l + 1);
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> m >> n >> k >> t;
  agility.resize(m);
  for (auto &i : agility) cin >> i;
  sort(agility.begin(), agility.end());
  reverse(agility.begin(), agility.end());
  traps.resize(k);
  for (auto &i : traps) {
    cin >> i.l >> i.r >> i.d;
  }
  sort(traps.begin(), traps.end());
  int l = 1;
  int r = m;
  int res = 0;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (get_time(agility[mid - 1]) <= t) {
      res = mid;
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  cout << res << '\n';
}
