#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int add(int a, int b) {
  long long x = a + b;
  if (x >= 1000000007) x -= 1000000007;
  if (x < 0) x += 1000000007;
  return x;
}
long long mul(long long a, long long b) { return (a * b) % 1000000007; }
long long pw(long long a, long long b) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return ans;
}
int cmmdc(int a, int b) {
  int c;
  while (b) {
    c = a % b;
    a = b;
    b = c;
  }
  return a;
}
int m, n, k, t;
int ag[200002];
struct x {
  int l, r, d;
};
x v[200002];
bool cmp(x a, x b) { return a.l < b.l; }
int chk(int mini) {
  int poz = 1;
  int ans = n + 1;
  int mxpoz = 0;
  while (mxpoz <= n) {
    int a = mxpoz;
    if (poz <= k && v[poz].l == a + 1) {
      ++a;
      int a2 = a;
      bool fnd = 0;
      while (poz <= k && v[poz].l <= a) {
        if (v[poz].d > mini) a = max(a, v[poz].r), fnd = 1;
        ++poz;
      }
      if (!fnd) ans -= 2;
      ans += 2 * (a - mxpoz);
      mxpoz = a;
    } else
      ++mxpoz;
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> m >> n >> k >> t;
  for (int i = 1; i <= m; ++i) cin >> ag[i];
  sort(ag + 1, ag + m + 1);
  for (int i = 1; i <= k; ++i) cin >> v[i].l >> v[i].r >> v[i].d;
  sort(v + 1, v + k + 1, cmp);
  int st = 1;
  int dr = m;
  int ans = 0;
  while (st <= dr) {
    int mid = (st + dr) / 2;
    if (chk(ag[mid]) <= t)
      ans = m - mid + 1, dr = mid - 1;
    else
      st = mid + 1;
  }
  cout << ans;
  return 0;
}
