#include <bits/stdc++.h>
#define int long long
#define F first
#define S second
#define pb push_back
#define pii pair<int,int>
using namespace std;
const int MX=2e5+9;
vector <pii> road[MX];
int a[MX];
int f(int x){
int ans=0;
int maxx=-1;
for(int i=0;i<MX;i++){
for(int j=0;j<road[i].size();j++){
pii a=road[i][j];
if(a.S>x){
maxx=max(maxx,a.F);
}
}
if(i<=maxx){
ans+=2;
}
}
return ans;
}
int BS(int n,int m,int t){
int l=0,r=m+1;
while(l+1<r){
int mid=(l+r)/2;
if(f(a[mid])+n+1<=t){
l=mid;
}
else{
r=mid;
}
}
return l;
}
int32_t main(){
ios::sync_with_stdio(0);cin.tie(0);
int m,n,k,t;
cin>>m>>n>>k>>t;
for(int i=1;i<=m;i++){
cin>>a[i];
}
a[0]=1e9;
sort(a+1,a+m+1);
reverse(a+1,a+m+1);
for(int i=0;i<k;i++){
int l,r,d;
cin>>l>>r>>d;
road[l].pb({r,d});
}
cout<<BS(n,m,t);
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CgojZGVmaW5lIGludCBsb25nIGxvbmcKI2RlZmluZSBGIGZpcnN0CiNkZWZpbmUgUyBzZWNvbmQKI2RlZmluZSBwYiBwdXNoX2JhY2sKI2RlZmluZSBwaWkgcGFpcjxpbnQsaW50PgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IGludCBNWD0yZTUrOTsKdmVjdG9yIDxwaWk+IHJvYWRbTVhdOwppbnQgYVtNWF07CgppbnQgZihpbnQgeCl7CiAgICBpbnQgYW5zPTA7CiAgICBpbnQgbWF4eD0tMTsKICAgIGZvcihpbnQgaT0wO2k8TVg7aSsrKXsKICAgICAgICBmb3IoaW50IGo9MDtqPHJvYWRbaV0uc2l6ZSgpO2orKyl7CiAgICAgICAgICAgIHBpaSBhPXJvYWRbaV1bal07CiAgICAgICAgICAgIGlmKGEuUz54KXsKICAgICAgICAgICAgICAgIG1heHg9bWF4KG1heHgsYS5GKTsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZihpPD1tYXh4KXsKICAgICAgICAgICAgYW5zKz0yOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiBhbnM7Cn0KCmludCBCUyhpbnQgbixpbnQgbSxpbnQgdCl7CiAgICBpbnQgbD0wLHI9bSsxOwogICAgd2hpbGUobCsxPHIpewogICAgICAgIGludCBtaWQ9KGwrcikvMjsKICAgICAgICBpZihmKGFbbWlkXSkrbisxPD10KXsKICAgICAgICAgICAgbD1taWQ7CiAgICAgICAgfQogICAgICAgIGVsc2V7CiAgICAgICAgICAgIHI9bWlkOwogICAgICAgIH0KICAgIH0KICAgIHJldHVybiBsOwp9CgppbnQzMl90IG1haW4oKXsKICAgIGlvczo6c3luY193aXRoX3N0ZGlvKDApO2Npbi50aWUoMCk7CiAgICBpbnQgbSxuLGssdDsKICAgIGNpbj4+bT4+bj4+az4+dDsKICAgIGZvcihpbnQgaT0xO2k8PW07aSsrKXsKICAgICAgICBjaW4+PmFbaV07CiAgICB9CiAgICBhWzBdPTFlOTsKICAgIHNvcnQoYSsxLGErbSsxKTsKICAgIHJldmVyc2UoYSsxLGErbSsxKTsKICAgIGZvcihpbnQgaT0wO2k8aztpKyspewogICAgICAgIGludCBsLHIsZDsKICAgICAgICBjaW4+Pmw+PnI+PmQ7CiAgICAgICAgcm9hZFtsXS5wYih7cixkfSk7CiAgICB9CiAgICBjb3V0PDxCUyhuLG0sdCk7CiAgICByZXR1cm4gMDsKfQo=