#include <stdio.h>
#include <vector>
using namespace std;
#define LL unsigned int
#define ff first
#define ss second
#define NRB 15
#define JEG 5
LL NR1;
int N, M, W, H, jeg;
char nr1[1 << 18];
pair <int, int> hash1[1 << 18][JEG];
int xx[100010];
int yy[100010];
inline int srch(int x, int y, int md1)
{
int i;
for (i = 0; i < nr1[md1]; i++)
if (x - W <= hash1[md1][i].ff && hash1[md1][i].ff <= x && y - H <= hash1[md1][i].ss && hash1[md1][i].ss <= y) return 1;
return 0;
}
inline LL trans(int x, int y) { return x / W + (LL) y / H * jeg; }
inline LL trans1(int x, int y) { return x + (LL) y * jeg; }
int main()
{
int i, x, y;
int md1;
freopen("ograzi.in", "r", stdin);
freopen("ograzi.out", "w", stdout);
scanf("%d %d %d %d", &N, &M, &W, &H);
LL aux;
jeg = 1000000 / W;
for (i = 1; i <= N; i++) scanf("%d %d", &xx[i], &yy[i]);
int max;
srand(666013);
while (1) {
NR1 = (LL) (rand() << 1) | 1;
max = 0;
for (i = 1; i <= N && max <= JEG; i++) {
aux = trans(xx[i], yy[i]);
md1 = (aux * NR1) >> NRB;
nr1[md1]++;
if (nr1[md1] > max) max = nr1[md1];
}
memset(nr1, 0, sizeof(nr1));
if (max <= JEG) break;
}
for (i = 1; i <= N; i++) {
aux = trans(xx[i], yy[i]);
md1 = (aux * NR1) >> NRB;
hash1[md1][nr1[md1]++] = make_pair(xx[i], yy[i]);
}
int ww, hh, rez = 0;
for (i = 1; i <= M; i++) {
scanf("%d %d", &x, &y);
ww = x / W; hh = y / H;
md1 = (trans1(ww, hh) * NR1) >> NRB;
if (srch(x, y, md1)) { rez++; continue; }
md1 = (trans1(ww-1, hh) * NR1) >> NRB;
if (srch(x, y, md1)) { rez++; continue; }
md1 = (trans1(ww, hh-1) * NR1) >> NRB;
if (srch(x, y, md1)) { rez++; continue; }
md1 = (trans1(ww-1, hh-1) * NR1) >> NRB;
if (srch(x, y, md1)) { rez++; continue; }
}
printf("%d\n", rez);
fclose(stdin);
fclose(stdout);
return 0;
}