#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1505;
int pref[N][N], block[N][N];
int main(){
	int h,w,n,m;
	scanf("%d %d %d %d",&h,&w,&n,&m);
	for(int i=0;i<=h+1;i++){
		block[i][0] = block[i][w+1] = -1;
	}
	for(int i=0;i<=w+1;i++){
		block[0][i] = block[h+1][i] = -1;
	}
	for(int i=0;i<n;i++){
		int x,y;
		scanf("%d %d",&x,&y);
		pref[x][y]++;
	}
	for(int i=0;i<m;i++){
		int x,y;
		scanf("%d %d",&x,&y);
		block[x][y] = -1;
	}
	for(int i=1;i<=h+1;i++){
		for(int j=1;j<=w+1;j++){
			pref[i][j] += pref[i-1][j]+pref[i][j-1]-pref[i-1][j-1];
		}
	}
	for(int i=0;i<=h+1;i++){
		for(int j=0;j<=w+1;j++){
//			printf("%d ",pref[i][j]);
		}
//		puts("");
	}
	for(int i=1;i<=h;i++){
		int start = 0;
		for(int j=1;j<=w+1;j++){
			if(block[i][j] == -1){
				int pt = pref[i][j-1]-pref[i][start]-pref[i-1][j-1]+pref[i-1][start];
//				printf("%d %d\n",j,pt);
				if(pt > 0){
//					printf("%d\n",j);
					for(int k=start+1;k<j;k++){
						block[i][k] = 1;
					}
				}
				start = j;
			}
		}
	}
	for(int i=1;i<=w;i++){
		int start = 0;
		for(int j=1;j<=h+1;j++){
			if(block[j][i] == -1){
				int pt = pref[j-1][i]-pref[start][i]-pref[j-1][i-1]+pref[start][i-1];
				if(pt > 0){
					for(int k=start+1;k<j;k++){
						block[k][i] = 1;
					}
				}
				start = j;
			}
		}
	}
	int ans = 0;
	for(int i=0;i<=h+1;i++){
		for(int j=0;j<=w+1;j++){
			if(block[i][j] == 1){
				ans++;
			}
//			printf("%4d",block[i][j]);
		}
//		puts("");
	}
	printf("%d\n",ans);
}
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(ll i = (m); i < (ll)(n); i++)
#define rep(i,n) REP(i, 0, n)
#define rrep(i,n) REP(i,1,n+1)
const int MX = 1505;

const int di[] = {1, 0, -1, 0}; 
const int dj[] = {0, -1, 0, 1};

int h,w,n,m;
bool light[MX][MX];
bool wall[MX][MX];
bool ok[MX][MX];

bool visited[MX][MX];
bool memo[MX][MX];


bool f(int v, int i, int j) {
    if (i < 0 || i >= h || j < 0 || j >= w) return false;
    if (wall[i][j]) return false;
    if (light[i][j]) return true;

    if (visited[i][j]) return memo[i][j];

    visited[i][j] = true;
    return memo[i][j] = f(v, i + di[v], j + dj[v]);
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> h >> w >> n >> m;    
    rep(i,n) {
        int r,c;
        cin >> r >> c;
        --r; --c;
        light[r][c] = true;
    }
    rep(i,m) {
        int r,c;
        cin >> r >> c;
        --r; --c;
        wall[r][c] = true;
    }

    rep(v,4) {
        rep(i,h) rep(j,w) visited[i][j] = false;
        rep(i,h) rep(j, w) if (f(v,i,j)) ok[i][j] = true;
    }

    int ans = 0;
    rep(i,h) rep(j,w) if (ok[i][j]) ++ans;
    cout  << ans << endl;
    return 0;
}
