#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
#define INF 1e18
#define all(x) (x).begin(), x.end()
#define int64_t 64
using namespace std;
typedef pair<int, int> pi;
const int MAX = 1e6 + 1;
// typedef vector<vector<ll>> matrix;
const ll PRIME = 1e9 + 7;
// typedef pair<int, pair<int, int>> ppi;
// const ll MAX = 1e6 + 1;
int gcd(int a, int b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
char s[1505][1505];
int ans[1502][1502];
void solve()
{
    int h, w, n, m;
    cin >> h >> w >> n >> m;

    fr(i, n)
    {
        int a, b;
        cin >> a >> b;
        a--, b--;
        s[a][b] = '.';
    }
    fr(i, m)
    {
        int a, b;
        cin >> a >> b;
        a--, b--;
        s[a][b] = '#';
    }
 
    fr(i, h)
    {
        bool chk = 0;
        fr(j, w)
        {
            if (s[i][j] == '.')
                chk = 1;
            else if (s[i][j] == '#')
                chk = 0;
            if (chk)
                ans[i][j] = 1;
        }
        chk = 0;
        frd(j, w- 1)
        {
            if (s[i][j] == '.')
                chk = 1;
            else if (s[i][j] == '#')
                chk = 0;
            if (chk)
                ans[i][j] = 1;
        }
    }
    fr(j, w)
    {
        bool chk = 0;
        fr(i, h)
        {
            if (s[i][j] == '.')
                chk = 1;
            if (s[i][j] == '#')
                chk = 0;
            if (chk)
                ans[i][j] = 1;
        }
        chk = 0;
        frd(i, h - 1)
        {
            if (s[i][j] == '.')
                chk = 1;
            else if (s[i][j] == '#')
                chk = 0;
            if (chk)
                ans[i][j] = 1;
        }
    }
    int cnt=0;
    fr(i,h)
    {
        fr(j,w)
        {
            if(ans[i][j]==1)
            {
               
                cnt++;
            }
        }
    }
    cout<<cnt;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int t;
    t = 1;
    // cin >> t;

    // int k=1;
    while (t--)
    {
        // cout << "Case " << k++ << ":\n";
        solve();
    }
}
#include <vector>
#include <iostream>
#include <utility>
#include <cstdio>
using namespace std;

#define EMPTY 0
#define BULB 1
#define BLOCK 2
#define LIGHT 3

int H,W,N,M;
vector<pair<int, int>> bulbs;
vector<vector<int>> grid;

int main() {
    cin >> H >> W >> N >> M;
    grid = vector<vector<int>>(H, vector<int>(W, EMPTY));
    int a, b, c, d;
    for(int i = 0; i < N; i++) {
        cin >> a >> b;
        bulbs.push_back({a-1, b-1});
        grid[a-1][b-1] = BULB;
    }
    for(int i = 0; i < M; i++) {
        cin >> c >> d;
        grid[c-1][d-1] = BLOCK;
    }

    // visited[i][j][index] grid[i][j]位置的灯的index方向是否被访问过
    vector<vector<vector<int>>> visited(H, vector<vector<int>>(W, vector<int>(4, 0)));

    // printf("H:%d, W:%d, N:%d, M:%d\n", H, W, N, M);
    // for(int i = 0; i < N; i++) {
    //     printf("%d %d\n", bulbs[i].first, bulbs[i].second);
    // }

    vector<int> dirs{0, 1, 0, -1, 0};
    int r, h, tr, th;
    // 循环每个灯，向上下左右扩展，直到扩展到block
    // 每次扩展时记录当前灯和扩展到的灯的方向是否访问过，便于缩小复杂度
    for(int i = 0; i < N; i++) {
        for(int index = 0; index < 4; index++) {
            r = bulbs[i].first;
            h = bulbs[i].second;
            if(visited[r][h][index]) {
                continue;
            }
            visited[r][h][index] = true;
            int tr = r + dirs[index];
            int th = h + dirs[index+1];
            while(tr >= 0 && tr < H && th >= 0 && th < W) {
                if(grid[tr][th] == BLOCK) {
                    break;
                }
                if(grid[tr][th] == BULB) {
                    visited[tr][th][index] = true;
                }
                if(grid[tr][th] == EMPTY) {
                    grid[tr][th] = LIGHT;
                }
                tr += dirs[index];
                th += dirs[index+1];
            }
        }
    }

    int ans = 0;
    for(int i = 0; i < H; i++) {
        for(int j = 0; j < W; j++) {
            if(grid[i][j] == BULB || grid[i][j] == LIGHT) {
                ans++;
            }
        }
    }

    printf("%d", ans);
    return 0;
}