#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using namespace std;
//using namespace atcoder;
const int mod = 998244353;
const int INF =1e9+1;
int ans=INF;

int main(){
    int h,w,n,m;cin>>h>>w>>n>>m;
    vector<vector<int>> math(h,vector<int> (w,0));
    vector<pair<int,int>> light(n);
    rep(i,n){
        int a,b;cin>>a>>b;
        math[a-1][b-1]=1;
        light[i]=make_pair(a-1,b-1);
    }
    rep(i,m){
        int a,b;cin>>a>>b;
        math[a-1][b-1]=2;
    }
    rep(i,n){
        int H=light[i].first,W=light[i].second;
        int W1=W;
        if(math[H][W]==3)continue;
        while(++W<w&&math[H][W]!=2){
            math[H][W]=3;
        }
        while(--W1>=0&&math[H][W1]!=2){
            math[H][W1]=3;
        }
    }
    rep(i,n){
        int H=light[i].first,W=light[i].second;
        int H1=H;
        if(math[H][W]==4)continue;
        while(++H<h&&math[H][W]!=2){
            math[H][W]=4;
        }
        while(--H1>=0&&math[H1][W]!=2){
            math[H1][W]=4;
        }
    }
    int ans=0;
    rep(i,h)rep(j,w){
        if(math[i][j]==3||math[i][j]==4||math[i][j]==1)ans++;
    }
    cout<<ans<<endl;
}

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ff first
#define ss second
#define pb push_back

int32_t  main(){
    int n,m,a,b;
    cin>>n>>m>>a>>b;
    int grid[n][m];
    memset(grid,-1,sizeof(grid));
    //for bulbs
    for(int i=0;i<a;i++){
        int r,c;
        cin>>r>>c;
        r--;c--;
        grid[r][c]=1;
    }
    //for blocks
    for(int i=0;i<b;i++){
        int r,c;
        cin>>r>>c;
        r--;c--;
        grid[r][c]=2;
    }
    /*for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cout<<grid[i][j]<<" ";
        }
        cout<<endl;
    }*/
    int ans[n][m];
    memset(ans,0,sizeof(ans));
    //now solve for individual rows first
    //yaar ab batao aage kya kare ya phir mtlb kya karna chahiye more precisely
    for(int i=0;i<n;i++){
        int s=0;
        int lit=0;
        for(int j=0;j<m;j++){
            //block aa gya
            if(grid[i][j]==2){
                
                s=j+1;
                lit=0;
            }
            //bulb aa gya
            else if(grid[i][j]==1){
                while(s<=j){
                    ans[i][s]=1;
                    s++;
                }
                lit=1;
                s=j+1;

            }
            else {
                if(lit) ans[i][j]=1;
            }
        }
    }


    //now solve for columns

    for(int j=0;j<m;j++){
        int s=0;
        int lit=0;
        for(int i=0;i<n;i++){
            //block aa gya
            if(grid[i][j]==2){
                
                s=i+1;
                lit=0;
            }
            //bulb aa gya
            else if(grid[i][j]==1){
                while(s<=i){
                    ans[s][j]=1;
                    s++;
                }
                lit=1;
                s=i+1;

            }
            else {
                if(lit) ans[i][j]=1;
            }
        }
    }

    int cnt=0;
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++){
            cnt+=ans[i][j];
        }
        //cout<<endl;
    }
    cout<<cnt<<endl;
    
}