#include <bits/stdc++.h>
using namespace std;
vector<int> l[200005];
int r[200005], a[200005], d[200005];
int _time(int p, int n) {
  int sos = 0, cnt = 0, ans = 0, to = -1;
  for (int i = 1; i <= n + 1; i++) {
    for (int j : l[i])
      if (p < d[j]) sos = 1, to = max(to, r[j]);
    if (sos) {
      cnt++;
      if (i == to) ans += 3 * cnt, sos = 0, cnt = 0;
    } else
      ans++;
  }
  return ans;
}
int main() {
  int m, n, k, t, mn, x, y, z;
  cin >> m >> n >> k >> t;
  for (int i = 1; i <= m; i++) cin >> a[i];
  sort(a + 1, a + 1 + m);
  for (int i = 1; i <= k; i++) {
    cin >> x >> y >> z;
    l[x].push_back(i);
    r[i] = y;
    d[i] = z;
  }
  int lo = 1, hi = m, mid;
  while (lo <= hi) {
    mid = lo + hi >> 1;
    if (_time(a[mid], n) > t)
      lo = mid + 1;
    else
      hi = mid - 1;
  }
  cout << m - lo + 1 << endl;
}
