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

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;
typedef vector<pii> vpii;

#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define mod 1000000007
#define FOR0(i,n) for(ll i=0;i<n;i++)
#define ff first
#define ss second   
#define mem(a,b) memset(a,b,sizeof(a))
#define ll long long
#define all(c) (c).begin(),(c).end()
#define fast ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);

#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds; 
  
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; 





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

    vi br[w+1],bc[h+1],dr[w+1],dc[h+1];

    map<pii,ll> mp;

    FOR0(i,n){
        ll x,y;
        cin>>x>>y;
        mp[{x,y}]=1;
        br[y].pb(x);
        bc[x].pb(y);
    }

    FOR0(i,m){
        ll x,y;
        cin>>x>>y;
        mp[{x,y}]=-1;
        dr[y].pb(x);
        dc[x].pb(y);
    }

    FOR0(i,h+1){
        sort(all(bc[i]));
        sort(all(dc[i]));
    }

    FOR0(i,w+1){
        sort(all(br[i]));
        sort(all(dr[i]));
    }

    ll ans=n;

    for(ll i=1;i<=h;i++){
        for(ll j=1;j<=w;j++){
            if(mp[{i,j}] !=0){
                continue;
            }

            auto it1=lower_bound(all(bc[i]),j);
            auto it2=lower_bound(all(dc[i]),j);

            ll d1=0,d2=w+1;
            if(it2 != dc[i].end()){
                d2 = *it2;
            }
            if(it2 != dc[i].begin()){
                it2--;
                d1 = *it2;
            }

            ll b1=-1,b2=-1;
            if(it1 != bc[i].end()){
                b2 = *it1;
            }
            if(it1 != bc[i].begin()){
                it1--;
                b1 = *it1;
            }

            if(b1>d1 && b1<d2){
                ans++;
                continue;
            }
            if(b2>d1 && b2<d2){
                ans++;
                continue;
            }

            // **************************************


            it1=lower_bound(all(br[j]),i);
            it2=lower_bound(all(dr[j]),i);

            d1=0,d2=h+1;
            if(it2 != dr[j].end()){
                d2 = *it2;
            }
            if(it2 != dr[j].begin()){
                it2--;
                d1 = *it2;
            }

            b1=-1,b2=-1;
            if(it1 != br[j].end()){
                b2 = *it1;
            }
            if(it1 != br[j].begin()){
                it1--;
                b1 = *it1;
            }

            if(b1>d1 && b1<d2){
                ans++;
                continue;
            }
            if(b2>d1 && b2<d2){
                ans++;
                continue;
            }

        }
    }

    cout<<ans<<endl;
}
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vr vector
#define endl "\n"
#define all(x) x.begin(),x.end()

template<class T> void read(vr<T> &arr)
{
	for (auto &x : arr)
		cin >> x;
}

template<class T> void read(T &x)
{
	cin >> x;
}

template<class T> void write(vr<T> &arr)
{
	for (auto x : arr)
		cout << x << " ";
	cout << endl;
}

template<class T> void write(vr<vr<T>> &arr)
{
	for (auto &x : arr)
	{
		for (auto &y : x)
			cout << y << " ";
		cout << endl;
	}
}

template<class T> void write(T &x)
{
	cout << x;
}

void solve() {
				cout<<setprecision(9);
				cout<<fixed;
				int a,b,c,d;
				cin>>a>>b>>c>>d;
				b = -b;
				if(a == c)
				{
								cout<<a;
								return;
				}
				double slop = 1.0 * (d - b) / (c - a);
				double newX = (slop * a - b) / slop;
				cout<<newX;
}

int32_t main() {
	cin.tie(nullptr);
	cout.tie(nullptr);
	int t = 1;
//	cin>>t;
	while (t--)
	{
		solve();
	}
	return  0;
}
