#include <bits/stdc++.h>
using namespace std;
unsigned long long min(unsigned long long x, unsigned long long y) {
  if (x < y) return x;
  return y;
}
unsigned long long max(unsigned long long x, unsigned long long y) {
  if (x < y) return y;
  return x;
}
long long min(long long x, long long y) {
  if (x < y) return x;
  return y;
}
long long max(long long x, long long y) {
  if (x < y) return y;
  return x;
}
double min(double x, double y) {
  if (x < y) return x;
  return y;
}
double max(double x, double y) {
  if (x < y) return y;
  return x;
}
unsigned long long gcd(unsigned long long x, unsigned long long y) {
  if (!x) return y;
  if (!y) return x;
  if (x > y) swap(x, y);
  return gcd(x, y % x);
}
unsigned long long inv(unsigned long long a, unsigned long long c) {
  if (a == 1) {
    return 1;
  }
  return ((c - (c / a)) * inv(c % a, c)) % c;
}
int n, m, k, t, a[200005] = {0};
vector<pair<int, int> > trap[200005];
int sol(int ag) {
  vector<int> r(n + 2, 0), dp(n + 2, 0);
  r[0] = 0;
  for (int i = 1; i <= n; i++) {
    r[i] = r[i - 1];
    for (int j = 0; j < trap[i].size(); j++) {
      if (trap[i][j].first > ag) {
        r[i] = max(r[i], trap[i][j].second);
      }
    }
  }
  for (int i = n; i >= 1; i--) {
    r[i] = r[r[i]];
  }
  dp[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (r[i + 1] < i + 1) {
      dp[i] = 1 + dp[i + 1];
    } else {
      dp[i] = 3 * (r[i + 1] - i) + dp[r[i + 1]];
    }
  }
  return dp[0] <= t;
}
int bs() {
  int l = 0, r = m - 1;
  while (l < r - 1) {
    int mid = (l + r) / 2;
    int ag = a[mid];
    if (sol(ag)) {
      r = mid;
    } else {
      l = mid;
    }
  }
  if (sol(a[l])) return m - l;
  if (sol(a[r])) return m - r;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> m >> n >> k >> t;
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  sort(a, a + m);
  for (int i = 0; i < k; i++) {
    int l, r, d;
    cin >> l >> r >> d;
    trap[l].push_back(make_pair(d, r));
  }
  cout << bs() << "\n";
  return 0;
}
