#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const double eps = 1e-9;
const int maxn = 3e5 + 5;
inline int read() {
  int ret = 0, sgn = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') sgn = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * sgn;
}
string str;
void reverse_sub(string &s, int l, int r) {
  for (int i = 0; i < (r - l + 1) / 2; i++) {
    swap(s[l + i], s[r - i]);
  }
}
long long ex_gcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long g = ex_gcd(b, a % b, x, y);
  long long temp = x;
  x = y;
  y = temp - a / b * y;
  return g;
}
const int N = 2e5 + 10;
int m, n, k, t;
int a[N];
bool cmp(int a, int b) { return a > b; }
struct node {
  int l, r, d;
} tt[N];
int cnt[N];
bool check(int mid) {
  int minn = a[mid];
  memset(cnt, 0, sizeof(cnt));
  for (int i = 1; i <= k; i++)
    if (minn < tt[i].d) cnt[tt[i].l]++, cnt[tt[i].r + 1]--;
  for (int i = 1; i <= n + 1; i++) cnt[i] += cnt[i - 1];
  int tot = 0;
  for (int i = 0; i <= n + 1; i++)
    if (cnt[i] > 0) tot++;
  return tot * 2 + n + 1 <= t;
}
int main() {
  scanf("%d%d%d%d", &m, &n, &k, &t);
  for (int i = 1; i <= m; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= k; i++) {
    scanf("%d %d %d", &tt[i].l, &tt[i].r, &tt[i].d);
  }
  int L = 0, R = m;
  sort(a + 1, a + m + 1, cmp);
  while (L < R) {
    int mid = (L + R + 1) >> 1;
    if (check(mid))
      L = mid;
    else
      R = mid - 1;
  }
  cout << L << endl;
  return 0;
}
