#include <iostream>
#include<fstream>
#include<vector>
using namespace std;
const int mod=26459;
const int nmax=200005;
struct ograda
{
int l,c,loc;
}aux;
struct punct
{
int x,y;
}ve[nmax][4];
string str;
vector<ograda> v[mod+5];
int key,i,j,n,m,xt,yt,xf,yf,ret,w,h,tot,c,num,cadran,lin,col,xi,yi,wh,locatii[nmax],myloc,locatiile;
inline void ins()
{
key=(lin*997+col)%mod;
for(int idx=0;idx<v[key].size();idx++)
{
if(v[key][idx].l==lin&&v[key][idx].c==col)
{
myloc=v[key][idx].loc;
ve[myloc][cadran].x=xi;
ve[myloc][cadran].y=yi;
return;
}
}
locatiile++;
aux.l=lin,aux.c=col,aux.loc=locatiile;
ve[locatiile][cadran].x=xi;
ve[locatiile][cadran].y=yi;
v[key].push_back(aux);
}
inline void finds()
{
key=(xf*997+yf)%mod;ret=0;
for(int idx=0;idx<v[key].size();idx++)
{
if(v[key][idx].l==xf&&v[key][idx].c==yf)
{
myloc=v[key][idx].loc;
if(ve[myloc][0].x>=xt&&ve[myloc][0].y>=yt) ret=1;
if(ve[myloc][1].x!=0&&ve[myloc][1].x<=xt&&ve[myloc][1].y>=yt) ret=1;
if(ve[myloc][2].x!=0&&ve[myloc][2].x<=xt&&ve[myloc][2].y<=yt) ret=1;
if(ve[myloc][3].y!=0&&ve[myloc][3].x>=xt&&ve[myloc][3].y<=yt) ret=1;
return;
}
}
return;
}
inline int getnum()
{
num=0;
while(str[c]>='0'&&str[c]<='9')
{num=num*10+str[c]-'0';c++;}
c++;
return num;
}
int main()
{
ifstream f("ograzi.in");
ofstream g("ograzi.out");
getline(f,str);
c=0;
n=getnum();m=getnum();w=getnum();h=getnum();
for(i=1;i<=n;i++)
{
getline(f,str);
c=0;
xt=getnum();yt=getnum();
xt++;yt++;
xf=xt/w;yf=yt/h;
cadran=2,lin=xf,col=yf,xi=xt,yi=yt;
ins();
cadran=3,lin=xf+1,col=yf,xi=xt+w,yi=yt;
ins();
cadran=0,lin=xf+1,col=yf+1,xi=xt+w,yi=yt+h;
ins();
cadran=1,lin=xf,col=yf+1,xi=xt,yi=yt+h;
ins();
}
for(i=1;i<=m;i++)
{
getline(f,str);
c=0;
xt=getnum();yt=getnum();
xt++;yt++;
xf=xt/w;yf=yt/h;
finds();
tot+=ret;
}
g<<tot;
return 0;
}