# include <cstdio>
# include <cstdlib>
# include <ext/hash_map>
using namespace std;
using namespace __gnu_cxx ;
# define verf ++poz == hg ? fread ( ch, 1, hg, stdin ), poz = 0 : 0
# define x first
# define y second
typedef pair <int, int> PR;
const char *FIN = "ograzi.in", *FOU = "ograzi.out" ;
const int dx[] = {0, 0, 1, 1}, dy[] = {0, 1, 0, 1}, hg = 1 << 13;
namespace __gnu_cxx {
template <> struct hash <PR> {
size_t operator () (PR val) const {
return val.x * 409 + val.y * 541;
}
} ;
}
hash_map <PR, PR> Map;
int N, M, W, H, poz, solution;
char ch[hg];
inline void cit ( int &x ) {
if ( ch[0] == '\0' ) fread ( ch, 1, hg, stdin ) ;
else for ( ; ch[poz] < '0' || ch[poz] > '9' ; verf ) ;
for ( x = 0 ; ch[poz] >= '0' && ch[poz] <= '9' ; x = x * 10 + ch[poz] - '0', verf ) ;
}
int main (void) {
freopen (FIN, "r", stdin);
cit (N), cit (M), cit (W), cit (H);
for (int i = 0, X, Y; i < N; ++i) {
cit (X), cit (Y);
Map[make_pair (X / W, Y / H)] = make_pair (X, Y);
}
for (int i = 0, X, Y, see; i < M; ++i) {
cit (X), cit (Y), see = 0;
for (int j = 0; j < 4 && see == 0; ++j) {
hash_map <PR, PR> :: iterator it = Map.find (make_pair (X / W - dx[j], Y / H - dy[j]));
if (it != Map.end () && X >= it -> y.x && X <= it -> y.x + W &&Y >= it -> y.y && Y <= it -> y.y + H) see = 1;
}
if (see) ++solution ;
}
fprintf (fopen (FOU, "w"), "%d", solution) ;
}