#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(v) v.begin(), v.end()
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;}

int main() {
    int H, W, N, M; cin >> H >> W >> N >> M;
    vector<vector<int>> board(H, vector<int>(W, 0));
    vector<vector<bool>> res(H, vector<bool>(W, false));
    rep(i, N) {
        int a, b; cin >> a >> b;
        --a, --b;
        board[a][b] = 1;
    }
    rep(i, M) {
        int c, d; cin >> c >> d;
        --c; --d;
        board[c][d] = -1;
    }

    rep(y, H) {
        bool light = false;
        rep(x, W) {
            if (board[y][x] == 1) light = true;
            if (board[y][x] == -1) light = false;
            if (light) res[y][x] = true;
        }
        light = false;
        for (int x = W-1; x >= 0; --x) {
            if (board[y][x] == 1) light = true;
            if (board[y][x] == -1) light = false;
            if (light) res[y][x] = true;
        }
    }
    rep(x, W) {
        bool light = false;
        rep(y, H) {
            if (board[y][x] == 1) light = true;
            if (board[y][x] == -1) light = false;
            if (light) res[y][x] = true;
        }
        light = false;
        for (int y = H-1; y >= 0; --y) {
            if (board[y][x] == 1) light = true;
            if (board[y][x] == -1) light = false;
            if (light) res[y][x] = true;
        }
    }

    int sum = 0;
    rep(y, H) rep(x, W) if (res[y][x]) sum++;
    cout << sum << endl;
}
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
//bool vis[1000];
int x[]={1,-1,0,0};
int y[]={0,0,1,-1};
//int f=0;
//int t[500000];
//int ll[500000];
//"'';

int main(){
int r,c,n,m;
cin>>r>>c>>n>>m;
int dp[r][c][4];
memset(dp,0,sizeof(dp));
vector<vector<int> > v(r,vector<int>(c,0));
queue<vector<int> > q;
int ans=0;
for(int i=0;i<n;i++){
    int a,b;
    cin>>a>>b;
    a--;
    b--;
    v[a][b]=1;
    for(int j=0;j<4;j++){
        q.push({a,b,j});
        dp[a][b][j]=1;
    }
}
for(int i=0;i<m;i++){
    int a,b;
    cin>>a>>b;
    a--;
    b--;
    v[a][b]=-1;
}
while(!q.empty()){
    vector<int> u=q.front();
    q.pop();
    int na=u[0]+x[u[2]];
    int nb=u[1]+y[u[2]];
    int nd=u[2];
    if(na<r&&na>=0&&nb<c&&nb>=0&&dp[na][nb][nd]==0&&v[na][nb]!=-1){
        dp[na][nb][nd]=1;
        q.push({na,nb,nd});
    }
}
for(int i=0;i<r;i++){
    for(int j=0;j<c;j++){
        int f=0;
        for(int k=0;k<4;k++){
            f=max(f,dp[i][j][k]);
        }
        ans+=f;
    }
}
cout<<ans<<endl;
}
