#include <bits/stdc++.h>
using namespace std;
int MOD = 1e9 + 7;
long long int power(long long int a, long long int b) {
  long long int res = 1;
  a = a % MOD;
  while (b > 0) {
    if (b & 1) {
      res = (res * a) % MOD;
      b--;
    }
    a = (a * a) % MOD;
    b >>= 1;
  }
  return res;
}
long long int fermat_inv(long long int y) { return power(y, MOD - 2); }
long long int gcd(long long int a, long long int b) {
  return (b == 0) ? a : gcd(b, a % b);
}
long long int min(long long int a, long long int b) { return (a > b) ? b : a; }
long long int max(long long int a, long long int b) { return (a > b) ? a : b; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int te = 1;
  while (te--) {
    int m, n, k, t;
    cin >> m >> n >> k >> t;
    int a[m];
    for (int i = 0; i < m; i++) cin >> a[i];
    sort(a, a + m, greater<int>());
    vector<vector<int> > v(k, vector<int>(3));
    for (int i = 0; i < k; i++) cin >> v[i][0] >> v[i][1] >> v[i][2];
    sort((v).begin(), (v).end());
    int l = 1, r = m, ans = 0;
    while (l <= r) {
      int mid = (l + r) / 2;
      int mn = a[mid - 1], mx = 0, cnt = n + 1;
      for (int i = 0; i < k; i++) {
        mx = max(mx, v[i][0] - 1);
        if (v[i][2] <= mn || v[i][1] <= mx) {
          continue;
        }
        if (v[i][0] - 1 > mx)
          cnt += 2 * (v[i][1] - v[i][0] + 1);
        else
          cnt += 2 * (v[i][1] - mx);
        mx = v[i][1];
      }
      if (cnt <= t)
        ans = mid, l = mid + 1;
      else
        r = mid - 1;
    }
    cout << ans;
  }
}
