#include <cstdio>
#include <map>
using namespace std;
struct punct
{
int x,y;
bool operator <(const punct &a) const
{
if(x==a.x) return y<a.y;
else return x<a.x;
}
};
const punct aux[4]={{0,0},{-1,0},{0,-1},{-1,-1}};
map<punct,punct> q;
int w,h;
int inclus(int x,int y,int a,int b)
{
if(x>=a && x<=a+w && y>=b && y<=b+h) return 1;
else return 0;
}
int main()
{
freopen("ograzi.in","r",stdin);
freopen("ograzi.out","w",stdout);
int n,m,sol=0,x,y;
scanf("%d%d%d%d",&n,&m,&w,&h);
for(int i=1;i<=n;i++)
{
scanf("%d%d",&x,&y);
q[{x/w,y/h}]={x,y};
}
for(int i=1;i<=m;i++)
{
scanf("%d%d",&x,&y);
int a=x/w,b=y/h;
for(int j=0;j<4;j++)
{
int x1=a+aux[j].x,y1=b+aux[j].y;
if(q.count({x1,y1})) sol+=inclus(x,y,q[{x1,y1}].x,q[{x1,y1}].y);
}
}
printf("%d",sol);
return 0;
}