#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > p;
long long m, n, k, t;
bool cmp(vector<long long>& a, vector<long long>& b) {
  return a[0] == b[0] ? a[2] > b[2] : a[0] < b[0];
}
long long solve(long long min_) {
  long long can = 0;
  long long pos1 = 0;
  long long pos2 = 0;
  long long ans = 0;
  long long i = 0;
  while (i != k) {
    if (p[i][2] <= min_) {
      can = p[i][0];
      i++;
    } else {
      if (p[i][1] <= pos1) {
        i++;
        continue;
      }
      if (p[i][0] <= pos1) {
        ans += p[i][1] - pos1;
        pos1 = p[i][1];
        i++;
        continue;
      }
      ans += pos1 - pos2 + p[i][0] - 1 - pos2 + p[i][1] - p[i][0] + 1;
      pos2 = p[i][0] - 1;
      pos1 = p[i][1];
    }
    if (min_ == 4) cout << ans << endl;
  }
  return ans + pos1 - pos2 + n + 1 - pos2;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> m >> n >> k >> t;
  vector<long long> abi(200002, 0);
  p = vector<vector<long long> >(k, vector<long long>(3));
  for (long long i = 0; i < m; i++) {
    long long a;
    cin >> a;
    abi[a]++;
  }
  for (long long i = 200000; i >= 0; i--) abi[i] += abi[i + 1];
  for (long long i = 0; i < k; i++) {
    cin >> p[i][0] >> p[i][1] >> p[i][2];
  }
  sort(p.begin(), p.end(), cmp);
  long long l = 0, r = 200002;
  while (l != r) {
    long long mid = l + (r - l) / 2;
    long long cost = solve(mid);
    if (cost > t)
      l = mid + 1;
    else
      r = mid;
  }
  cout << abi[l] << endl;
  return 0;
}
