#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define COUT(x) cout<<(x)<<"\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define REP(i,n) for(int i=0;i<n;i++)
#define YES(x) cout<<(x?"YES":"NO")<<"\n"
#define Yes(x) cout<<(x?"Yes":"No")<<"\n"
#define dump(x) cout<<#x<<" = "<<(x)<<"\n"
#define endl "\n"
using G = vector<vector<int>>;
using M = map<int,int>;
using P = pair<int,int>;
using PQ = priority_queue<int>;
using PQG = priority_queue<int,vector<int>,greater<int>>;
using V = vector<int>;
using ll = long long;
using edge = struct { int to; int cost; };
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;}
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;


const int MX = 1500;
const pair<int, int> direction[4] = {
  { -1, 0 }, { 1, 0 }, { 0, -1 }, { 0, 1 }
};

int h,w,n,m;

bool light[MX][MX];
bool wall[MX][MX];
bool ok[MX][MX];

bool visited[MX][MX];
bool memo[MX][MX];

bool f(int d, int i, int j) {
  if (i < 0 || j < 0 || h <= i || w <= j) return false;
  if (wall[i][j]) return false;
  if (light[i][j]) return true;
  if (visited[i][j]) return memo[i][j];

  visited[i][j] = true;
  int ni = i + direction[d].first;
  int nj = j + direction[d].second;

  return memo[i][j] = f(d, ni, nj);
}

int main() {
  IOS;
  cin >> h >> w >> n >> m;
  REP(i,n) {
    int a,b; cin >> a >> b;
    a--; b--; light[a][b] = 1;
  }
  REP(i,m) {
    int c,d; cin >> c >> d;
    c--; d--; wall[c][d] = 1;
  }

  REP(d,4) {
    REP(i,h) REP(j,w) visited[i][j] = 0;
    REP(i,h) REP(j,w) if(f(d,i,j)) ok[i][j] = 1;
  }

  int ans = 0;
  REP(i,h) REP(j,w) ans += ok[i][j];
  COUT(ans);
  return 0;
}
#include<bits//stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(ll i = n-1;i >= 0;i--)
#define ALL(obj) begin(obj), end(obj)
#define RALL(a) rbegin(a),rend(a)
typedef long long ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e18;
ll mod = 1e9+7;
template <class Abel> struct BIT {
    Abel UNITY_SUM = 0;
    vector<Abel> dat;
    BIT(int n, Abel unity = 0) : UNITY_SUM(unity), dat(n, unity) { }
    void init(int n) {
        dat.assign(n, UNITY_SUM);
    }
    inline void add(int a, Abel x) {
        for (int i = a; i < (int)dat.size(); i |= i + 1)
            dat[i] = dat[i] + x;
    }
    inline Abel sum(int a) {
        Abel res = UNITY_SUM;
        for (int i = a - 1; i >= 0; i = (i & (i + 1)) - 1)
            res = res + dat[i];
        return res;
    }
    inline Abel sum(int a, int b) {
        return sum(b) - sum(a);
    }
    void print() {
        for (int i = 0; i < (int)dat.size(); ++i)
            cout << sum(i, i + 1) << ",";
        cout << endl;
    }
};
int main(){
   int h,w,m,x,y;cin >>h>>w>>m;
   vector<vector<int>> X(h),Y(w);
   rep(i,m){
      cin >>x >>y;x--;y--;
      X[x].push_back(y);
      Y[y].push_back(x);
   }rep(i,h) {
      X[i].push_back(w);sort(ALL(X[i]));
   }
   rep(i,w) {
      Y[i].push_back(h);sort(ALL(Y[i]));
   }
   ll ans = 0;
   rep(i,X[0][0]) ans += Y[i][0];
   BIT<int> bit(w+2);
   for(int i=X[0][0];i<w;i++) bit.add(i,1);
   rep(i,Y[0][0]){
      ans += bit.sum(0,X[i][0]);
      for(int j:X[i]) if(bit.sum(j,j+1)==0) bit.add(j,1);
   }cout << ans << endl;
}