#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const double PI = acos(-1);
const long long MOD = 1000000007;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int M, N, K, T;
vector<int> A;
vector<tuple<int, int, int>> trap;
vector<int> L;
bool f(int k) {
  if (k > M) return false;
  if (k < 1) return true;
  int x = A[k - 1];
  fill(L.begin(), L.end(), 0);
  int res = 0;
  for (int i = 0; i < (int)(K); i++) {
    int d, l, r;
    tie(l, r, d) = trap[i];
    if (d <= x) continue;
    L[l]++;
    L[r + 1]--;
  }
  int p = 0;
  for (int i = 0; i < (int)(N + 1); i++) L[i + 1] += L[i];
  for (int i = 0; i < (int)(N + 2); i++)
    if (L[i] > 0) p++;
  res = N + 1 + 2 * p;
  if (res <= T) return true;
  return false;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> M >> N >> K >> T;
  A.resize(M);
  for (int i = 0; i < (int)(M); i++) cin >> A[i];
  for (int i = 0; i < (int)(K); i++) {
    int l, r, d;
    cin >> l >> r >> d;
    trap.emplace_back(l, r, d);
  }
  sort(A.begin(), A.end());
  reverse(A.begin(), A.end());
  sort(trap.begin(), trap.end());
  L.resize(N + 2);
  int left = 0;
  int right = M + 1;
  while (right - left > 1) {
    int mid = left + (right - left) / 2;
    if (f(mid))
      left = mid;
    else
      right = mid;
  }
  cout << left << endl;
}
