#include <bits/stdc++.h>
using namespace std;
typedef bool boool;
typedef long long ll;
#define vl vector<ll>
#define vb vector<boool>
#define vs vector<string>
#define vp vector<pair<ll, ll>>
#define vvl vector<vector<ll>>
#define vvp vector<vector<pair<ll, ll>>>
#define mod 1000000007
#define all(x) x.begin(), x.end()
#define rep1(i, n) for (long long i=0; i<(long long)(n); i++)
#define rep2(i, s, e) for (long long i=(s); i<(long long)(e); i++)
#define GET_MACRO(_1,_2,_3,NAME,...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)

int main() {
  int h, w;
  cin >> h >> w;
  vector<string> vec(h, "");
  vector<string> a(h, "");
  rep(i, h){
    rep(j, w){
      vec[i]+=".";
      a[i]+=".";
    }
  }
  int n, m;
  cin >> n >> m;
  rep(i, n){
    int y, x;
    cin >> y >> x;
    x--; y--;
    vec[y][x] = 'o';
  }
  rep(i, m){
    int y, x;
    cin >> y >> x;
    x--; y--;
    vec[y][x] = 'x';
  }
  
  rep(i, h){
    bool light = false;
    int num = 0;
    rep(j, w){
       if(vec[i][j]=='o'){
         light = true;
         num++;
       }else if(vec[i][j]=='x'){
         if(light){
           rep(k, 1, num+1) a[i][j-k] ='p';
           light = false;
           num = 0;
         }else{
           num = 0;
         }
       }else{
         num++;
       }
    }
    if(light) rep(k, 1, num+1) a[i][w-k] ='p';
  }
  rep(i, w){
    bool light = false;
    int num = 0;
    rep(j, h){
       if(vec[j][i]=='o'){
         light = true;
         num++;
       }else if(vec[j][i]=='x'){
         if(light){
           rep(k, 1, num+1) a[j-k][i] ='p';
           light = false;
           num = 0;
         }else{
           num = 0;
         }
       }else{
         num++;
       }
    }
    if(light) rep(k, 1, num+1) a[h-k][i] ='p';
  }
  
  int ans = 0;
  rep(i, h){
    rep(j, w){
      if(a[i][j]=='p') ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
// E - Akari
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<n;++i)

// bitでフラグ管理
enum Flag{
	NONE   = 0b000, // なし
	BRIGHT = 0b001, // 明るい
	BULB   = 0b010, // 電球
	BLOCK  = 0b100, // ブロック
};

int main(){
	int H, W, N, M; cin>>H>>W>>N>>M;
	vector<vi> grid(H, vi(W));
	rep(i, N){
		int a, b; cin>>a>>b;
		grid[a-1][b-1] = BULB;
	}
	rep(i, M){
		int c, d; cin>>c>>d;
		grid[c-1][d-1] = BLOCK;
	}
	// 座標変換で回転
	vi I(H); rep(i, H) I[i] = i;
	vi J(W); rep(i, W) J[i] = i;
	rep(t, 4){
		for(int i:I){ // 90° 回転 * 4
			int f = NONE; // flag
			for(int j:J){
				int h = i, w = j;
				if(t%2) swap(h, w); // (i,j) -> (h,w)
				// grid 設定 / フラグ更新
				if(grid[h][w] & BULB) f = BRIGHT;
				if(grid[h][w] & BLOCK) f = NONE;
				grid[h][w] |= f;
			}
		}
		// 90° 回転
		swap(I, J); // 45° 線対称
		reverse(J.begin(), J.end()); // 軸線対称
	}
	int ans = 0;
	for(vi v:grid) for(int x:v) if(x & BRIGHT) ans++;
	cout<< ans <<endl;
}
