#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using tiii = tuple<int,int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
//const double PI = M_PI;
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}
int cnt_gcj = 0;
#define gcj_put cout<<"Case #" << ++cnt_gcj << ": ";

/* Coding Space */
int table[1502][1502];
bool used[1502][1502];
bool dfs(int y, int x, bool state,int cnt,bool vec){
  if(table[y][x] == 2){return state;}
  else if(table[y][x] == 1){
    bool ret = 0;
    if(vec == 0){
      ret = dfs(y+1,x,1,cnt+1,vec);
    }
    else{
      ret = dfs(y,x+1,1,cnt+1,vec);
    }
    return ret;
  }else{
    bool ret = (vec == 0?dfs(y+1,x,state,cnt+1,vec):dfs(y,x+1,state,cnt+1,vec));
    if(ret == 0) return 0;
    else{
      if(used[y][x]) ;
      else used[y][x] = 1;
      return ret;
    }
  }
}
int main(){
  int h,w,n,m; cin >> h >> w >> n >> m;
 
  rep(i,n){
    int a,b; cin >> a >> b;
    table[a][b] = 1;
  }
  rep(i,m){
    int a,b; cin >> a >> b;
    table[a][b] = 2;
  }
  rep(i,w+1) table[0][i] = 2,table[h+1][i] = 2;
  rep(i,h+1) table[i][0] = 2, table[i][w+1] = 2;

  rep(i,h+1)rep(j,w+1)if(table[i][j] == 2)dfs(i+1,j,0,0,0),dfs(i,j+1,0,0,1);
  ll ans = 0;
  //rep(i,h+1)rep(j,w+1){if(table[i][j] == 1 || used[i][j] == 1) cerr << i << ' ' << j << endl;}
  rep(i,h+1)rep(j,w+1){if(table[i][j] == 1 || used[i][j] == 1) ans++;}
  cout << ans << endl;
  return 0;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-variable"

#include <iostream> // IO
#include <cmath> // sqrt, trig, ceil, log
#include <utility> // swap, pair 

// #include <algorithm> // sort, binary search, reverse, merge
// #include <bitset>
// #include <cstdio> 
// #include <cstdlib> //abs, atoi, rand 
// #include <iterator> 
// #include <map>  
// #include <queue>
// #include <set> 
// #include <stack> 
// #include <string> // std string
// #include <vector> 

// #include <chrono> // non c style time
// #include <complex>
// #include <deque>
// #include <iomanip> // setprecision
// #include <tuple>

#define fo(i, a, b) for(i=a; i<=b; i++)
#define ro(i, b, a) for(i=b; i>=a; i--)
#define foe(it, x) for(auto it=x.begin(); it!=x.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define fil(x, y) memset(x, y, sizeof(x))
#define deb(x) cout << #x << " " << x << "\n"
#define sz(a) ((int)(a.size()))

using namespace std;

using ll = long long;

const int N = 1e5+3;
const int inf = 1e9+3;
const ll M = 1e9+7;
const ll T = 998244353;
const double pi = acos(-1);

void solve()
{
	int a,b,x,y,fi,si;cin>>a>>b>>x>>y;
	if(b<a){
		fi = x;
		si = min(y,2*x);
		cout << fi + abs(b-(a-1))*si << "\n";
	}
	else {
		fi = x;
		si = min(y,2*x);
		cout << fi + abs(b-a)*si << "\n";
	}
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	#ifdef Holmes7 
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	#endif

	int _t=1,i;
	//cin >> _t;
	for(i=1;i<=_t;i++){
		//cout << "Case #" << i << ": ";
		solve();
	}
	return 0;
}
