#include <bits/stdc++.h>
using namespace std;
const long long MAXVAL = (long long)1e18 + 1;
const long long MOD = 1000000007;
const int INF = 1000000000 + 1;
long long poww(int x, long long pow) {
  if (pow == 0ll) return 1;
  if (pow == 1ll) return x % MOD;
  long long ans = poww(x, pow >> 1) % MOD;
  ans = (ans * ans) % MOD;
  if ((pow & 1) == 1) {
    ans = (ans * x) % MOD;
  }
  return ans % MOD;
}
const int maxx = 1000000 + 1;
int fenw[maxx];
void fen_ins(int x) {
  while (x < maxx) {
    fenw[x]++;
    x += x & (-x);
  }
}
void fen_ers(int x) {
  while (x < maxx) {
    assert(fenw[x] > 0);
    fenw[x]--;
    x += x & (-x);
  }
}
int fen_sum(int x) {
  int sum = 0;
  while (x > 0) {
    sum += fenw[x];
    x -= x & (-x);
  }
  return sum;
}
int fen_find(int kth) {
  int l = -1;
  int r = maxx;
  while (l + 1 < r) {
    int mid = (l + r) >> 1;
    if (fen_sum(mid) < kth) {
      l = mid;
    } else {
      r = mid;
    }
  }
  assert(l + 1 == r);
  assert(fen_sum(l) < kth && fen_sum(r) >= kth);
  return r;
}
void fen_erase(int kth) {
  int ans = fen_find(kth);
  fen_ers(ans);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int q = 1;
  while (q-- > 0) {
    int n, m, k, t;
    cin >> m >> n >> k >> t;
    int ag[m];
    vector<pair<int, pair<int, int>>> traps;
    for (int i = 0; i < m; ++i) cin >> ag[i];
    for (int i = 0; i < k; ++i) {
      int x, y, z;
      cin >> x >> y >> z;
      traps.push_back({z, {x, y}});
    }
    sort(traps.begin(), traps.end(), greater<pair<int, pair<int, int>>>());
    sort(ag, ag + m, greater<int>());
    int l = -1;
    int r = m + 1;
    while (l + 1 < r) {
      int mid = (l + r) >> 1;
      if (mid == 0) {
        l = mid;
        continue;
      } else if (mid > m) {
        r = mid;
        continue;
      }
      assert(mid > 0);
      int ag_mid = ag[mid - 1];
      vector<pair<int, int>> ints;
      for (auto xx : traps) {
        if (xx.first <= ag_mid) break;
        ints.push_back(xx.second);
      }
      vector<int> line(n + 1, 0);
      for (pair<int, int>& pa : ints) {
        line[pa.first - 1]++;
        line[pa.second]--;
      }
      int cnt = 0;
      int bal = 0;
      for (int i = 0; i <= n; ++i) {
        bal += line[i];
        assert(bal >= 0);
        if (bal > 0) {
          cnt++;
        }
      }
      int time = 2 * cnt + n + 1;
      if (time > t) {
        r = mid;
      } else {
        l = mid;
      }
    }
    cout << l << "\n";
  }
  return 0;
}
