#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
vector<pair<int, pair<int, int>>> disarm;
vector<int> arr;
int m, n, k, t;
bool good(int mid) {
  vector<int> temp(n + 2, 0);
  vector<int> special_case(n + 2, 0);
  for (int i = mid; i <= ((int)(disarm).size()) - 1; i++) {
    int l = disarm[i].second.first;
    int r = disarm[i].second.second;
    if (l == r) special_case[l] = 1;
    temp[l] += -1;
    temp[r] += 1;
  }
  for (int i = 1; i <= n; i++) temp[i] += temp[i - 1];
  int last = 0, tm = 0;
  for (int i = 1; i <= n + 1; i++) {
    if (temp[i] >= 0) {
      if (special_case[i]) tm += 2;
      if (last == i - 1)
        tm++;
      else
        tm += 3 * (i - last);
      last = i;
    }
  }
  return (tm <= t);
}
void solve() {
  cin >> m >> n >> k >> t;
  arr.resize(m);
  for (int i = 0; i <= m - 1; i++) cin >> arr[i];
  for (int i = 0; i <= k - 1; i++) {
    int l, r, ag;
    cin >> l >> r >> ag;
    disarm.push_back({ag, {l, r}});
  }
  sort(disarm.begin(), disarm.end());
  int l = 0, r = ((int)(disarm).size()) - 1, bound = -1;
  while (l <= r) {
    int mid = l + (r - l) / 2;
    if (good(mid)) {
      bound = mid;
      r = mid - 1;
    } else
      l = mid + 1;
  }
  sort(arr.begin(), arr.end());
  if (bound == 0)
    cout << m;
  else if (bound == -1)
    cout << arr.end() -
                lower_bound(arr.begin(), arr.end(), disarm.back().first);
  else {
    if (disarm[bound].first == disarm[bound - 1].first)
      cout << arr.end() -
                  lower_bound(arr.begin(), arr.end(), disarm[bound].first);
    else
      cout << arr.end() -
                  lower_bound(arr.begin(), arr.end(), disarm[bound - 1].first);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  solve();
}
