#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
using namespace std;
FILE *f=fopen("ograzi.in","r"),*g=fopen("ograzi.out","w");
const int maxx=100005;
int difx[5]={0,0,-1,-1},dify[5]={0,-1,0,-1},x,y,a1,a2,key,i,n,m,w,h,l,j,nr,lung;
vector < pair<int , int> > hash[maxx+5];
char s[20];
int line(int x,int y,int l)
{
a1=(x+w-1)/w;
a2=(y+h-1)/h;
if(a1-difx[l]>=0&&a2+dify[l]>=0)
return ((a1+difx[l])*100+(a2+dify[l]))%maxx;
return 100006;
}
bool apar(pair<int , int > a,pair<int , int > b)
{
if(b.first<=a.first+w&&b.first>=a.first&&b.second<=a.second+h&&b.second>=a.second)
return true;
return false;
}
void parse_read(int &x,int &y)
{
int i;
fgets(s,15,f);
lung=strlen(s)-1;
for(x=y=0 , nr=1 , i=0;i<lung;i++)
{
if(s[i]>='0'&&s[i]<='9')
{
if(nr==1)
{
while(s[i]>='0'&&s[i]<='9'&&i<lung)
{
x=x*10+s[i]-'0';
i++;
}
nr=2;
}
else
{
while(s[i]>='0'&&s[i]<='9'&&i<lung)
{
y=y*10+s[i]-'0';
i++;
}
i=lung;
}
}
}
}
void read()
{
fscanf(f,"%d%d%d%d",&n,&m,&w,&h);
fgets(s,3,f);
for(i=1;i<=n;i++)
{
parse_read(x,y);
key=line(x,y,0);
hash[key].push_back(make_pair(x,y));
}
for(i=1;i<=m;i++)
{
parse_read(x,y);
for(l=0;l<=3;l++)
{
key=line(x,y,l);
for(j=0;j<hash[key].size();j++)
if(apar(hash[key][j],make_pair(x,y)))
{
nr++;
l=5;
break;
}
}
}
}
int main()
{
read();
fprintf(g,"%d\n",nr);
return 0;
}