#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memset
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
using namespace std;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;

inline int read()
{
    int X=0; bool flag=1; char ch=getchar();
    while(ch<'0'|ch>'9') {if(ch=='-') flag=0; ch=getchar();}
    while(ch>='0'&&ch<='9') {X=(X<<1)+(X<<3)+ch-'0'; ch=getchar();}
    if(flag) return X;
    return ~(X-1);
}

const int dx[4]={0,0,-1,1},dy[4]={-1,1,0,0};

int row,col,n,m;
map<PII,int> mp;
int b[1510][1510];
bool st[1510][1510];


int main() {
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>row>>col>>n>>m;
    for(int i=1;i<=n;++i){
        int x,y;
        cin>>x>>y;
        mp[make_pair(x,y)]++;
    }

    for(int i=1;i<=m;++i){
        int x,y;
        cin>>x>>y;
        b[x][y]++;
    }

    int ans=0;
    for(auto w:mp){
        int x=w.fi.fi;
        int y=w.fi.se;
        for(int i=y;i>=1;--i){
            if(st[x][i]) continue;
            if(b[x][i]) break;
            st[x][i]=true;
            ans++;
        }
        for(int i=y+1;i<=col;++i){
            if(st[x][i]) continue;
            if(b[x][i]) break;
            st[x][i]=true;
            ans++;
        }
        for(int i=x;i>=1;--i){
            if(st[i][y]) continue;
            if(b[i][y]) break;
            st[i][y]=true;
            ans++;
        }
        for(int i=x+1;i<=row;++i){
            if(st[i][y]) continue;
            if(b[i][y]) break;
            st[i][y]=true;
            ans++;
        }
    }

    cout<<ans;


    return 0;
}

#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define sz 1529
#define mx 10000000000008
#define mod 1000000007
ll n,t,arr[6][500009],brr[6][sz][sz],crr[6][sz][sz],grid[sz][sz];
vector<ll>v;
int main()
{
      ll w,h,m;
      scanf("%lld %lld %lld %lld",&w,&h,&n,&m);
      for(int i=1;i<=n;i++){
        scanf("%lld %lld",&arr[1][i],&arr[2][i]);
       ll a,b;
       a=arr[1][i];
       b=arr[2][i];
       grid[a][b]=1;
      }
      for(int i=1;i<=m;i++){
        scanf("%lld %lld",&arr[3][i],&arr[4][i]);
       ll a,b;
       a=arr[3][i];
       b=arr[4][i];
       grid[a][b]=-1;
      }
      for(int i=1;i<=w;i++)
      {
          for(int j=1;j<=h;j++)
          {
              if(grid[i][j]==1)
              {
                  brr[1][i][j]=j;
                  crr[1][i][j]=crr[1][i][j-1];
              }
              else if(grid[i][j]==-1)
              {
                  crr[1][i][j]=j;
                  brr[1][i][j]=brr[1][i][j-1];
              }
              else
              {
                  brr[1][i][j]=brr[1][i][j-1];
                  crr[1][i][j]=crr[1][i][j-1];
              }
          }
      }
      for(int i=1;i<=w;i++)
      {
          for(int j=h;j>0;j--)
          {
              if(grid[i][j]==1)
              {
                  brr[2][i][j]=j;
                  crr[2][i][j]=crr[2][i][j+1];
              }
              else if(grid[i][j]==-1)
              {
                  crr[2][i][j]=j;
                  brr[2][i][j]=brr[2][i][j+1];
              }
              else
              {
                  brr[2][i][j]=brr[2][i][j+1];
                  crr[2][i][j]=crr[2][i][j+1];
              }
          }
      }
     // printf("%lld %lld\n",brr[2][1][1],crr[2][1][1]);
      for(int i=1;i<=h;i++)
      {
          for(int j=1;j<=w;j++)
          {
              if(grid[j][i]==1)
              {
                  brr[3][j][i]=j;
                  crr[3][j][i]=crr[3][j-1][i];
              }
              else if(grid[j][i]==-1)
              {
                  crr[3][j][i]=j;
                  brr[3][j][i]=brr[3][j-1][i];
              }
              else
              {
                  brr[3][j][i]=brr[3][j-1][i];
                  crr[3][j][i]=crr[3][j-1][i];
              }
          }
      }
      for(int i=1;i<=h;i++)
      {
          for(int j=w;j>0;j--)
          {
              if(grid[j][i]==1)
              {
                  brr[4][j][i]=j;
                  crr[4][j][i]=crr[4][j+1][i];
              }
              else if(grid[j][i]==-1)
              {
                  crr[4][j][i]=j;
                  brr[4][j][i]=brr[4][j+1][i];
              }
              else
              {
                  brr[4][j][i]=brr[4][j+1][i];
                  crr[4][j][i]=crr[4][j+1][i];
              }
          }
      }
      ll ans=0;
      for(int i=1;i<=w;i++)
      {
          for(int j=1;j<=h;j++)
          {
              if(grid[i][j])
                continue;
                ll a=0;
              if((brr[1][i][j]!=0 && (brr[1][i][j]>crr[1][i][j] || crr[1][i][j]==0)))
                a++;
              if((brr[2][i][j]!=0 && (brr[2][i][j]<crr[2][i][j] || crr[2][i][j]==0)))
                a++;
                if((brr[3][i][j]!=0 && (brr[3][i][j]>crr[3][i][j] || crr[3][i][j]==0)))
                a++;
                if((brr[4][i][j]!=0 && (brr[4][i][j]<crr[4][i][j] || crr[4][i][j]==0)))
                a++;
                if(a){
                    ans++;
                // printf("   %d %d\n",i,j);
                }
          }
      }
      printf("%lld\n",ans+n);
  return 0;
}
