#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define ALL(v) v.begin(), v.end()
using ll = long long;
const int LIGHT = 1;
const int BLOCK = -1;
const int BLANK = 0;
const int LIT = 2;

int main()
{
    int H, W, N, M;
    cin >> H >> W >> N >> M;
    //light A:x, B:y   block C:x, D:y
    //vector<int> A(N), B(N), C(M), D(M);
    //REP(i, N) cin >> A.at(i) >> B.at(i);
    //REP(i, M) cin >> C.at(i) >> D.at(i);
    vector<vector<int>> S(H, vector<int>(W, BLANK));
    //1:light, -1:block, 0:blank
    int A, B, C, D;
    REP(i, N)
    {
        cin >> A >> B;
        S.at(A - 1).at(B - 1) = LIGHT;
    }
    REP(i, M)
    {
        cin >> C >> D;
        S.at(C - 1).at(D - 1) = BLOCK;
    }

    int b;

    //scan from left to right

    REP(i, H)
    {
        bool lit = false;
        int left = 0, right;
        REP(j, W)
        {
            int z = S.at(i).at(j);
            if (z == LIGHT)
            {
                lit = true;
            }

            if (z == BLOCK || (z != BLOCK && j == W - 1))
            {
                right = j + 1;
                if (lit)
                {
                    FOR(k, left, right)
                    {
                        if (S.at(i).at(k) == BLANK)
                        {
                            S.at(i).at(k) = LIT;
                        }
                    }
                    lit = false;
                }
                left = j + 1;
            }
        }
    }

    //scan from top to bottom

    REP(j, W)
    {
        bool lit = false;
        int top = 0, bottom;
        REP(i, H)
        {
            int z = S.at(i).at(j);
            if (z == LIGHT)
            {
                lit = true;
            }

            if (z == BLOCK || (z != BLOCK && i == H - 1))
            {
                bottom = i + 1;
                if (lit)
                {
                    FOR(k, top, bottom)
                    {
                        if (S.at(k).at(j) == BLANK)
                        {
                            S.at(k).at(j) = LIT;
                        }
                    }
                    lit = false;
                }
                top = i + 1;
            }
        }
    }

    int count = 0;
    REP(i, H)
    {
        REP(j, W)
        {
            if(S.at(i).at(j) > 0) count += (S.at(i).at(j) > 0) ? 1 : 0;
        }
    }

    cout << count << endl;
}
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
ll H,W,N,M;
  cin>>H>>W>>N>>M;
  
  vector<vector<ll>> vec(H,vector<ll> (W,0));
  
 
  for(ll i=0;i<N;i++) {
ll A,B;
    cin>>A>>B;
 A--;
    B--;
    vec[A][B]=1;
  }
 
  for(ll i=0;i<M;i++) {
ll C,D;
    cin>>C>>D;
    C--;
    D--;
    vec[C][D]=2;
  }
  
  
  vector<vector<bool>> note(H,vector<bool> (W,false));
  ll ans=0;
  
  for(ll i=0;i<W;i++) {
ll count=0;
    
    for(ll j=0;j<H;j++) {
      if(vec[j][i]==0) {
        if(count<=0) {
count--;
        }
        else {
count++;
      }
      }
      
      else if(vec[j][i]==1) {
        if(count<=0) {
count*=-1;
        }
        count++;
      }
      
        
        else {
if(count<=0) {
count=0;
}
          else {
            ans+=count;
            for(ll h=j-count;h<j;h++) {
              note[h][i]=true;
            }
            count=0;
          }
        }
        
      
       if(j==H-1&&count>0) {
         ans+=count;
for(ll h=j-count+1;h<=j;h++) {
note[h][i]=true;
}
       }
      
      }
      
      
  }
      
      for(ll i=0;i<H;i++) {
ll count=0;
        for(ll j=0;j<W;j++) {

          
  
  
  
  
  if(vec[i][j]==0) {
if(count<=0) {
count--;
}
    else {
count++;
    }
  }
          else if(vec[i][j]==1) {
if(count<=0) {
count*=-1;
}
            count++;
          }
          
          
          else {
if(count<=0) {
count=0;
}
            else {
ans+=count;
              for(ll h=j-count;h<j;h++) {
if(note[i][h]) {
ans--;
}
              }
              count=0;
            }
          }
            
            if(count>0&&j==W-1) {
ans+=count;
              for(ll h=j-count+1;h<=j;h++) {
if(note[i][h]) {
ans--;
}
              }
              
            }
          
          
          }
        }
        
        cout<<ans<<endl;
      }
             
  
  
  
  
  

  