#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define sz(a) (int)(a.size())
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define owo ios_base::sync_with_stdio(0);cin.tie(0);
#define MOD (ll)(998244353)
#define INF (ll)(1e18)
#define debug(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define time__(d) for(long blockTime = 0; (blockTime == 0 ? (blockTime=clock()) != 0 : false);\
debug("%s time : %.4fs\n", d, (double)(clock() - blockTime) / CLOCKS_PER_SEC))
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> PII;
typedef pair<int,int> pii;
typedef vector<vector<int>> vii;
typedef vector<vector<ll>> VII;
ll gcd(ll a,ll b){if(!b)return a;else return gcd(b,a%b);}
int main()
{
  owo
	int h,w;
	cin>>h>>w;
	VII grid(h+2,vector<ll>(w+2)),grid2(h+2,vector<ll>(w+2));
	int n,m;
	cin>>n>>m;
	VII row(h+1),col(w+1);
	vector<pii>a(n);
	for(int i=0;i<n;i++){
		cin>>a[i].fi>>a[i].se;
	}
	for(int i=0;i<m;i++){
		int x,y;
		cin>>x>>y;
		row[x].pb(y);
		col[y].pb(x);
	}
	//cout<<'\n';
	for(int i=1;i<=h;i++){row[i].pb(0);row[i].pb(w+1);sort(all(row[i]));}
	for(int i=1;i<=w;i++){col[i].pb(0);col[i].pb(h+1);sort(all(col[i]));}
	for(int i=0;i<n;i++){
		int x = a[i].fi;
		int y = a[i].se;
		int p = ub(all(row[x]),y)-row[x].begin();
		int l = row[x][p-1]+1;
		int r = row[x][p];
		//cout<<l<<" "<<r<<'\n';
		grid[x][l]++;
		grid[x][r]--;
	    p = ub(all(col[y]),x)-col[y].begin();
		l = col[y][p-1]+1;
		r = col[y][p];
		//cout<<l<<" "<<r<<'\n';
		grid2[l][y]++;
		grid2[r][y]--;
		//cout<<'\n';
	}
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
		   grid[i][j]+=grid[i][j-1];	
		}
	}
	
	for(int j=1;j<=w;j++){
		for(int i=1;i<=h;i++){
			grid2[i][j]+=grid2[i-1][j];
		}
	}
	ll ans = 0;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(grid[i][j]+grid2[i][j])ans++;
			//cout<<grid[i][j]+grid2[i][j]<<" ";
		}
		//cout<<'\n';
	}
	cout<<ans;
	
}

#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;
using ll = long long;
using ull = unsigned long long;
const static int MAX_H = 1500;
const static int MAX_W = 1500;
bool is_wall_or_light[MAX_H][MAX_W];

int main(){
    unsigned H, W, N, M;
    scanf("%u %u %u %u", &H, &W, &N, &M);
    vector<int> light_row[H], light_column[W];
    vector<int> wall_row[H], wall_column[W];
    unsigned answer = N;
    int a, b, c, d;
    for (unsigned i = 0; i < N; i++){
        scanf("%d %d", &a, &b);
        a--, b--;
        light_row[a].push_back(b);
        light_column[b].push_back(a);
        is_wall_or_light[a][b] = true;
    }
    for (unsigned i = 0; i < M; i++){
        scanf("%d %d", &c, &d);
        c--, d--;
        wall_row[c].push_back(d);
        wall_column[d].push_back(c);
        is_wall_or_light[c][d] = true;
    }
    for (unsigned i = 0; i < H; i++){
        light_row[i].push_back(-2);
        light_row[i].push_back(W+1);
        wall_row[i].push_back(-1);
        wall_row[i].push_back(W);
        sort(light_row[i].begin(), light_row[i].end());
        sort(wall_row[i].begin(), wall_row[i].end());
    }
    for (unsigned i = 0; i < W; i++){
        light_column[i].push_back(-2);
        light_column[i].push_back(H+1);
        wall_column[i].push_back(-1);
        wall_column[i].push_back(H);
        sort(light_column[i].begin(), light_column[i].end());
        sort(wall_column[i].begin(), wall_column[i].end());
    }
    for (int i = 0; i < H; i++){
        for (int j = 0; j < W; j++){
            if(is_wall_or_light[i][j]) continue;
            if(auto it_light = lower_bound(light_row[i].begin(), light_row[i].end(), j), it_wall = lower_bound(wall_row[i].begin(), wall_row[i].end(), j);
            *it_light < *it_wall || *(--it_light) > *(--it_wall)){
                answer++;
                continue;
            }
            if(auto it_light = lower_bound(light_column[j].begin(), light_column[j].end(), i), it_wall = lower_bound(wall_column[j].begin(), wall_column[j].end(), i);
            *it_light < *it_wall || *(--it_light) > *(--it_wall)){
                answer++;
                continue;
            }
        }
    }
    printf("%u\n", answer);    
	return 0;
}