#include <iostream>
#include <vector>
using namespace std;

void check(bool& Akaried, vector<vector<int>>& Map, int i, int j) {
	switch (Map[i][j]) {
	case 1:
		break;
	case -1:
		if (Akaried) Map[i][j] = 1;
		break;
	case 2:
		Akaried = true;
		break;
	case 3:
		Akaried = false;
		break;
	}
	return;
}

int main() {
	int H, W, N, M;
	cin >> H >> W >> N >> M;
	vector<vector<int>> Map(H, vector<int>(W, -1));
	for (int i = 0; i < N; i++) {
		int a, b;
		cin >> a >> b;
		a--, b--;
		Map[a][b] = 2;
	}
	for (int i = 0; i < M; i++) {
		int c, d;
		cin >> c >> d;
		c--, d--;
		Map[c][d] = 3;
	}
	for (int i = 0; i < H; i++) {
		bool Akaried = false;
		for (int j = 0; j < W; j++) {
			check(Akaried, Map, i, j);
		}
		for (int j = W - 1; j >= 0; j--) {
			check(Akaried, Map, i, j);
		}
	}
	for (int j = 0; j < W; j++) {
		bool Akaried = false;
		for (int i = 0; i < H; i++) {
			check(Akaried, Map, i, j);
		}
		for (int i = H - 1; i >= 0; i--) {
			check(Akaried, Map, i, j);
		}
	}
	int ans = 0;
	for (int i = 0; i < H; i++) for (int j = 0; j < W; j++) ans += (Map[i][j] == 1 || Map[i][j] == 2);
	cout << ans << endl;
}

#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
//using namespace atcoder;
using ll = long long;
using P = pair<int, int>;

int main()
{
	int H, W, N, M;
	cin >> H >> W >> N >> M;
	vector<vector<int>> dp(H + 2, vector<int>(W + 2));
	rep(i, N)
	{
		int a, b;
		cin >> a >> b;
		dp[a][b] = 2;
	}
	rep(i, M)
	{
		int a, b;
		cin >> a >> b;
		dp[a][b] = -1;
	}

	bool judge = false;
	for (int h = 1; h <= H; h++)
	{
		judge = false;
		for (int w = 1; w <= W; w++)
		{
			if (dp[h][w] < 0){
				judge = false;
			}
			else if (dp[h][w] > 1)
			{
				judge = true;
			}
			else if (judge)
			{
				dp[h][w] = 1;
			}
		}
		judge = false;
		for (int w = W; w > 0; w--)
		{
			if (dp[h][w] < 0){
				judge = false;
			}
			else if (dp[h][w] > 1)
			{
				judge = true;
			}
			else if (judge)
			{
				dp[h][w] = 1;
			}
		}
	}

	for (int w = 1; w <= W; w++)
	{
		judge = false;
		for(int h = 1; h <= H; h++){
			if (dp[h][w] < 0){
				judge = false;
			}
			else if (dp[h][w] > 1)
			{
				judge = true;
			}
			else if (judge)
			{
				dp[h][w] = 1;
			}
		}
		judge = false;
		for(int h = H;h > 0; h--){
			if (dp[h][w] < 0){
				judge = false;
			}
			else if (dp[h][w] > 1)
			{
				judge = true;
			}
			else if (judge)
			{
				dp[h][w] = 1;
			}
		}
	}

	int ans = 0;
	for (int h = 1; h <= H; h++)
	{
		for (int w = 1; w <= W; w++)
		{
			if (dp[h][w] > 0)
				ans++;
		}
	}
	cout << ans << endl;
	return 0;
}
