
// Problem: E - Akari
// Contest: AtCoder - AtCoder Beginner Contest 182
// URL: https://atcoder.jp/contests/abc182/tasks/abc182_e
// Memory Limit: 1024 MB
// Time Limit: 2500 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)	
typedef pair<int,int> pii;
#define x first
#define y second

const int N = 1600;
pii blimit[N][N][4];
bool bubl[N][N],wall[N][N];
int main()
{
	int h,w,n,m;scanf("%d%d%d%d",&h,&w,&n,&m);
	forn(i,1,n)
	{
		int x,y;scanf("%d%d",&x,&y);
		bubl[x][y] = 1;
	}
	forn(i,1,m)
	{
		int x,y;scanf("%d%d",&x,&y);
		wall[x][y] = 1;
	}
	pii cur = {0,0};
	//left -> right
	forn(i,1,h)	
	{
		cur = {0,0};
		forn(j,1,w)
		{
			if(bubl[i][j])	cur.x = i,cur.y = j;
			if(wall[i][j])	cur.x = 0,cur.y = 0;
			blimit[i][j][0] = cur;
		}
	}
	//right -> left
	forn(i,1,h)
	{
		cur = {0,0};
		for(int j = w;j >= 1;--j)
		{
			if(bubl[i][j])	cur.x = i,cur.y = j;
			if(wall[i][j])	cur.x = 0,cur.y = 0;
			blimit[i][j][1] = cur;
		}
	}
	//up -> down
	forn(j,1,w)
	{
		cur = {0,0};
		forn(i,1,h)
		{
			if(bubl[i][j])	cur.x = i,cur.y = j;
			if(wall[i][j])	cur.x = 0,cur.y = 0;
			blimit[i][j][2] = cur;
		}
	}
	// down -> up
	forn(j,1,w)
	{
		cur = {0,0};
		for(int i = h;i >= 1;--i)
		{
			if(bubl[i][j])	cur.x = i,cur.y = j;
			if(wall[i][j])	cur.x = 0,cur.y = 0;
			blimit[i][j][3] = cur;
		}
	}
	// forn(i,1,h)	forn(j,1,w)
	// {
		// printf("#%d %d\n",i,j);
		// forn(k,0,3)	printf("%d %d %d\n",k,blimit[i][j][k].x,blimit[i][j][k].y);
	// }
	int res = 0;
	forn(i,1,h)	forn(j,1,w)
	{
		int ok = 0;
		forn(k,0,3)	if(blimit[i][j][k].x)	ok = 1;
		// if(ok)	cout << i << " " << j << endl;
		res += ok;
	}
	printf("%d",res);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;

int main() {
  int h, w, n, m;
  cin >> h >> w >> n >> m;
  int map[h][w] = {};
  int a, b, c, d, ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a >> b;
    map[a - 1][b - 1] = -1;
    ans++;
  }
  for (int i = 0; i < m; i++) {
    cin >> c >> d;
    map[c - 1][d - 1] = -2;
  }

  bool light;
  int x, y;
  queue<int> q;

  for (int i = 0; i < h; i++) {
    light = false;
    q = queue<int>();
    for (int j = 0; j < w; j++) {
      if (map[i][j] == 0) {
        if (light) {
          map[i][j] = 1;
          ans++;
        } else {
          q.push(i);
          q.push(j);
        }
      } else if (map[i][j] == -1) {
        while (!q.empty()) {
          x = q.front();
          q.pop();
          y = q.front();
          q.pop();
          map[x][y] = 1;
          ans++;
        }
        light = true;
      } else if (map[i][j] == -2) {
        light = false;
        q = queue<int>();
      }
    }
  }

  for (int j = 0; j < w; j++) {
    light = false;
    q = queue<int>();
    for (int i = 0; i < h; i++) {
      if (map[i][j] == 0) {
        if (light) {
          map[i][j] = 1;
          ans++;
        } else {
          q.push(i);
          q.push(j);
        }
      } else if (map[i][j] == -1) {
        while (!q.empty()) {
          x = q.front();
          q.pop();
          y = q.front();
          q.pop();
          map[x][y] = 1;
          ans++;
        }
        light = true;
      } else if (map[i][j] == -2) {
        light = false;
        q = queue<int>();
      }
    }
  }
   cout << ans;
}
