#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF =1001001001;
using P = pair<int,int>;

int main(void) 
{
    int h,w;
    ll n,m;
    cin >> h >> w >> n >> m;

    vector<vector<bool>>ab(h,vector<bool>(w,false));
    vector<vector<bool>>cd(h,vector<bool>(w,false));

    rep(i,n) 
    {
        int ai,bi;
        cin >> ai >> bi;
        ab[ai-1][bi-1] = true;
    }
    rep(i,m) 
    {
        int ci,di;
        cin >> ci >> di;
        cd[ci-1][di-1] = true;
    }

    int ans = 0;

    rep(i,h)
    {
        rep(j,w)
        {
            if(cd[i][j]) 
            {
                continue;
            }
            if(ab[i][j]) 
            {
                ans++;
                continue;
            }

            //上下左右に探索
            bool ok = false;
            for(int hh = i; hh < h; hh++)
            {
                if(cd[hh][j]) break;
                if(ab[hh][j]) 
                {
                    ans++;
                    ok =true;
                    break;
                }
            }
            if(ok) continue;
            
            for(int hh = i; hh >= 0; hh--)
            {
                if(cd[hh][j]) break;
                if(ab[hh][j]) 
                {
                    ans++;
                    ok =true;
                    break;
                }
            }
            if(ok) continue;
            for(int ww= j; ww >= 0; ww--)
            {
                if(cd[i][ww]) break;
                if(ab[i][ww]) 
                {
                    ans++;
                    ok =true;
                    break;
                }
            }
            if(ok) continue;
            for(int ww= j; ww < w; ww++)
            {
                if(cd[i][ww]) break;
                if(ab[i][ww]) 
                {
                    ans++;
                    ok =true;
                    break;
                }
            }
            if(ok) continue;
        }
    }

    cout << ans << endl;
    return 0;
}
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<deque>
#include<queue>
#include<stack>
using namespace std;
#define int long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dup(x,y) (((x)+(y)-1)/(y))
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int INF = 1e18;
const long double PI = (acos(-1));



signed main() {
	int X, Y, A, B;
	cin >> X >> Y >> A >> B;
	int ans = 0;
	while (1) {
		if (X * A < Y && (double)A <= 1e18 / (double)X && X * A < X + B) {
			ans++;
			X = X * A;
		}
		else break;
	}
	ans += (Y - X - 1) / B;
	cout << ans << endl;
}