/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author tatsumack
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(12)

using namespace std;

typedef pair<int, int> P;

class EAkari {
public:
    void solve(std::istream& cin, std::ostream& cout) {
        int H, W, N, M;
        cin >> H >> W >> N >> M;
        vector<int> A(N), B(N), C(M), D(M);
        vector<vector<int>> block(H, vector<int>(W));
        REP(i, N) {
            cin >> A[i] >> B[i];
            A[i]--, B[i]--;
        }
        REP(i, M) {
            cin >> C[i] >> D[i];
            C[i]--, D[i]--;
            block[C[i]][D[i]] = 1;
        }

        vector<set<pair<int, int>>> sh(W), sw(H);
        REP(i, N) {
            sh[B[i]].insert({A[i], 1});
            sw[A[i]].insert({B[i], 1});
        }
        REP(i, M) {
            sh[D[i]].insert({C[i], 2});
            sw[C[i]].insert({D[i], 2});
        }

        int res = 0;
        REP(i, H) {
            REP(j, W) {
                if (block[i][j]) continue;
                {
                    auto itr = sh[j].upper_bound({i, 0});
                    if (itr != sh[j].end()) {
                        if (itr->second == 1) {
                            res++;
                            continue;
                        }
                    }
                    if (itr != sh[j].begin()) {
                        itr--;
                        if (itr->second == 1) {
                            res++;
                            continue;
                        }
                    }
                }
                {
                    auto itr = sw[i].upper_bound({j, 0});
                    if (itr != sw[i].end()) {
                        if (itr->second == 1) {
                            res++;
                            continue;
                        }
                    }
                    if (itr != sw[i].begin()) {
                        itr--;
                        if (itr->second == 1) {
                            res++;
                            continue;
                        }
                    }
                }
            }
        }
        cout << res << endl;
    }
};


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);

    EAkari solver;
    solver.solve(in, out);
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
// #include <atcoder/all>
// using namespace atcoder;

void Main()
{
    int h, w, n, m;
    cin >> h >> w >> n >> m;
    vector<vector<int>> b(h, vector<int>(w));
    vector<vector<int>> l(h, vector<int>(w));
    vector<vector<int>> f(h, vector<int>(w));
    for (int i = 0; i < n; i++)
    {
        int y, x;
        cin >> y >> x;
        y--; x--;
        l[y][x] = 1;
    }
    for (int i = 0; i < m; i++)
    {
        int y, x;
        cin >> y >> x;
        y--; x--;
        b[y][x] = 1;
    }
    bool on = false;
    int ans = 0;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if (b[i][j] == 1) on = false;
            if (l[i][j] == 1) on = true;
            if (on && f[i][j] == 0) {
                f[i][j] = 1;
                ans++;
            }
        }
        on = false;
        for (int j = w-1; j >= 0; j--)
        {
            if (b[i][j] == 1) on = false;
            if (l[i][j] == 1) on = true;
            if (on && f[i][j] == 0) {
                f[i][j] = 1;
                ans++;
            }
        }
        on = false;
    }
    for (int j = 0; j < w; j++)
    {
        for (int i = 0; i < h; i++)
        {
            if (b[i][j] == 1) on = false;
            if (l[i][j] == 1) on = true;
            if (on && f[i][j] == 0) {
                f[i][j] = 1;
                ans++;
            }
        }
        on = false;
        for (int i = h-1; i >= 0; i--)
        {
            if (b[i][j] == 1) on = false;
            if (l[i][j] == 1) on = true;
            if (on && f[i][j] == 0) {
                f[i][j] = 1;
                ans++;
            }
        }
        on = false;
    }

    // ofstream ofs("output.txt");
    // for (int i = 0; i < h; i++)
    // {
    //     for (int j = 0; j < w; j++)
    //     {
    //         if (l[i][j]) ofs << "*";
    //         else if (b[i][j]) ofs << "@";
    //         else ofs << f[i][j];
    //     }
    //     ofs << "\n";
    // }
    // ofs << "\n";
    
    
    cout << ans << endl;
}

int main(int argc, char **argv)
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    Main();
    return 0;
}
