#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int H, W, N, M;
    cin >> H >> W >> N >> M;
    vector<vector<char>> grid1(H, vector<char>(W, '.'));
    vector<vector<char>> grid2(H, vector<char>(W, '.'));
    int a, b, c, d;
    rep(i, 0, N) {
        cin >> a >> b;
        --a, --b;
        grid1[a][b] = grid2[a][b] = '?';
    }
    rep(i, 0, M) {
        cin >> c >> d;
        --c, --d;
        grid1[c][d] = grid2[c][d] = '#';
    }
    rep(i, 0, H) {
        rep(j, 1, W) {
            if (grid1[i][j] != '.') {
                continue;
            }
            if (grid1[i][j - 1] == '?' || grid1[i][j - 1] == '+') {
                grid1[i][j] = '+';
            }
        }
        rrep(j, W - 1, 0) {
            if (grid1[i][j] != '.') {
                continue;
            }
            if (grid1[i][j + 1] == '?' || grid1[i][j + 1] == '+') {
                grid1[i][j] = '+';
            }
        }
    }
    rep(i, 0, W) {
        rep(j, 1, H) {
            if (grid2[j][i] != '.') {
                continue;
            }
            if (grid2[j - 1][i] == '?' || grid2[j - 1][i] == '-') {
                grid2[j][i] = '-';
            }
        }
        rrep(j, H - 1, 0) {
            if (grid2[j][i] != '.') {
                continue;
            }
            if (grid2[j + 1][i] == '?' || grid2[j + 1][i] == '-') {
                grid2[j][i] = '-';
            }
        }
    }
    int ans = 0;
    rep(i, 0, H) rep(j, 0, W) {
        if (grid1[i][j] == '?' || grid1[i][j] == '+' || grid2[i][j] == '-') {
            ++ans;
        }
    }
    cout << ans << endl;
    return 0;
}
#include <iostream>
#include <vector>

using namespace std;

int mapn[1500][1500];
int a, b, c, d;
int h, w, n, m;
int ans;

int main() {
  cin >> h >> w >> n >> m;
  for (int i = 0; i < n; ++i) {
    cin >> a >> b;
    mapn[a - 1][b - 1] = 1;
  }
  for (int i = 0; i < m; ++i) {
    cin >> c >> d;
    mapn[c - 1][d - 1] = -1;
  }
  for (int i = 0; i < h; ++i) {
    bool l = 0;
    for (int j = 0; j < w; ++j) {
      if (mapn[i][j] == 1) {
        l = true;
      } else if (mapn[i][j] == -1) {
        l = false;
      } else if (l) {
        mapn[i][j] = 2;
      }
    }
    l = 0;
    for (int j = w - 1; j >= 0; --j) {
      if (mapn[i][j] == 1) {
        l = true;
      } else if (mapn[i][j] == -1) {
        l = false;
      } else if (l) {
        mapn[i][j] = 2;
      }
    }
  }
  for (int j = 0; j < w; ++j) {
    bool l = false;
    for (int i = 0; i < h; ++i) {
      if (mapn[i][j] == 1) {
        l = true;
      } else if (mapn[i][j] == -1) {
        l = false;
      } else if (l) {
        mapn[i][j] = 2;
      }
    }
    l = false;
    for (int i = h - 1; i >= 0; --i) {
      if (mapn[i][j] == 1) {
        l = true;
      } else if (mapn[i][j] == -1) {
        l = false;
      } else if (l) {
        mapn[i][j] = 2;
      }
    }
  }
  for (int i = 0; i < h; ++i) {
    for (int j = 0; j < w; ++j) {
      ans += mapn[i][j] > 0;
    }
  }
  cout << ans;
}