#include<bits/stdc++.h>
//#include<atcoder/all>
//using namespace atcoder;
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair< ll, ll > Pi;
using vl = vector<ll>;
using vs = vector<string>;
using vvl = vector<vector<ll>>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll H,W,N,M;
    cin >>H>>W>>N>>M;
    vector<ll>A(N),B(N),C(M),D(M);
    //vector<ll>A2(H),B2(N),C2(M),D2(M);

    vvl G(H,vl(W));
    vvl G1(H);
    vvl G2(W);
    vvl G3(H);
    vvl G4(W);
    rep(i,N){
        cin>>A[i]>>B[i];
        A[i]--,B[i]--;
        G1[A[i]].pb(B[i]);
        G2[B[i]].pb(A[i]);
        G[A[i]][B[i]]=1;
    }
    

    rep(i,M){
        cin>>C[i]>>D[i];
        C[i]--,D[i]--;
        G3[C[i]].pb(D[i]);
        G4[D[i]].pb(C[i]);
        G[C[i]][D[i]]=2;
    }
    rep(i,H){
        sort(all(G1[i]));
        sort(all(G3[i]));
    }

    rep(i,W){
        sort(all(G2[i]));
        sort(all(G4[i]));
    }
    ll ans=0;
    rep(i,H){
        rep(j,W){

            if(G[i][j]==2)continue;
            if(G[i][j]==1){
                ans++;
                continue;
            }
            bool flag=0;
            ll idx1 = lower_bound(all(G1[i]),j)-G1[i].begin();
            ll idx2 = lower_bound(all(G3[i]),j)-G3[i].begin();
            ll w1=G1[i].size();
            ll w2=G3[i].size();
            if(idx1!=w1 && idx2==w2){
                flag=1;
            }else if(idx1!=w1){
                if(G1[i][idx1]<G3[i][idx2]){
                    flag=1;
                }
            }
            if(idx1!=0&&idx2==0){
                flag=1;
            }else if(idx1!=0){
                if(G1[i][idx1-1]>G3[i][idx2-1]){
                    flag=1;
                }
            }

            ll idx3 = lower_bound(all(G2[j]),i)-G2[j].begin();
            ll idx4 = lower_bound(all(G4[j]),i)-G4[j].begin();
            ll h1=G2[j].size();
            ll h2=G4[j].size();
            if(idx3!=h1 && idx4==h2){
                flag=1;
            }else if(idx3!=h1){
                if(G2[j][idx3]<G4[j][idx4]){
                    flag=1;
                }
            }
            if(idx3!=0&&idx4==0){
                flag=1;
            }else if(idx3!=0){
                if(G2[j][idx3-1]>G4[j][idx4-1]){
                    flag=1;
                }
            }
            ans+=flag;

        }
    }
    cout<<ans<<endl;
    
    


    return 0;
    

}
#include <bits/stdc++.h>

#define fst first
#define snd second
#define ll long long
#define ld long double
#define pb push_back
#define emp emplace_back
#define pii pair<int, int>
#define usg unsigned
#define sg signed
#define mp make_pair

using namespace std;

void setIO(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
}

const ld PI = 4*atan((ld)1);
const int INF = 1e9+7;
const ll _INF = 1e18;
const int N = 1507;

int a[N][N];
bool vld[N][N];

int main(){
	setIO();
	int h, w, n, m;
	cin >> h >> w >> n >> m;
	for (int i = 0; i < n; i++){
		int r, c;
		cin >> r >> c;
		a[r][c] = 1;
	}
	for (int i = 0; i < m; i++){
		int r, c;
		cin >> r >> c;
		a[r][c] = -1;
	}
	// right
	for (int i = 1; i <= h; i++){
		bool ok = 0;
		for (int j = 1; j <= w; j++){
			if (a[i][j] == 1) ok = 1;
			else if (a[i][j] == -1) ok = 0;
			vld[i][j] |= ok;
		}
	}
	// left
	for (int i = 1; i <= h; i++){
		bool ok = 0;
		for (int j = w; j >= 1; j--){
			if (a[i][j] == 1) ok = 1;
			else if (a[i][j] == -1) ok = 0;
			vld[i][j] |= ok;
		}
	}
	// down
	for (int i = 1; i <= w; i++){
		bool ok = 0;
		for (int j = 1; j <= h; j++){
			if (a[j][i] == 1) ok = 1;
			else if (a[j][i] == -1) ok = 0;
			vld[j][i] |= ok;
		}
	}
	// up
	for (int i = 1; i <= w; i++){
		bool ok = 0;
		for (int j = h; j >= 1; j--){
			if (a[j][i] == 1) ok = 1;
			else if (a[j][i] == -1) ok = 0;
			vld[j][i] |= ok;
		}
	}
	int ans = 0;
	for (int i = 1; i <= h; i++){
		for (int j = 1; j <= w; j++){
			if (vld[i][j]) ans++;
		}
	}
	cout << ans << endl;
}
