#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 3;
const long long MOD = 1e9 + 7;
pair<int, int> traps[MAX];
int a[MAX];
int l[MAX], r[MAX], d[MAX];
int m, n, k, t;
bool check(int x) {
  vector<pair<int, int> > v;
  for (int i = 1; i <= k; i++) {
    if (d[i] > a[x]) v.push_back({l[i], r[i]});
  }
  int time = 0;
  sort(v.begin(), v.end());
  if (v.empty()) return true;
  int L = v[0].first, R = v[0].second;
  time += L - 1;
  for (pair<int, int> p : v) {
    if (p.first > R) {
      time += 2 * (R - (L - 1));
      time += p.first - 1 - (L - 1);
      L = p.first;
    }
    R = max(R, p.second);
  }
  time += 2 * (R - (L - 1));
  time += n + 1 - (L - 1);
  return (time <= t);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> m >> n >> k >> t;
  for (int i = 1; i <= m; i++) cin >> a[i];
  sort(a + 1, a + m + 1, greater<int>());
  for (int i = 1; i <= k; i++) {
    cin >> l[i] >> r[i] >> d[i];
  }
  int lo = 1, hi = m;
  if (!check(1)) return cout << "0", 0;
  while (hi > lo) {
    int mid = (lo + hi + 1) / 2;
    if (check(mid))
      lo = mid;
    else
      hi = mid - 1;
  }
  cout << lo;
}
