#include <bits/stdc++.h>

using namespace std;
#define set_precision(ans,l) cout << fixed << setprecision(l)<<ans;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define repb(i, a, b) for (int i = a; i >= b; i--)
#define vi vector<int>
#define vl vector<long long int>
#define Vi vector<vector<int>>
#define vpi vector<pair<int,int>>
#define seti set<int>
#define setl set<ll>
#define dseti set<int, greater<int>>
#define dsetl set<ll, greater<ll>>
#define mseti multiset<int>
#define msetl multiset<ll>
#define dmseti multiset<int, greater<int>>
#define dmsetl multiset<ll, greater<ll>>
#define sortA(arr) sort(arr.begin(), arr.end())
#define dsortA(arr) sort(arr.begin(), arr.end(), greater<ll>())
#define ssort(arr) stable_sort(arr.begin(), arr.end())
#define nth(v,n) nth_element(v.begin,v.begin+n-1,v.end())
#define dnth(v,n) nth_element(v.begin,v.begin+n-1,v.end(), greater<ll>())
#define init(a)  memset((a),0,sizeof(a))
#define pi pair<int,int>
#define pb push_back
#define pl pair<ll,ll>
#define ll long long
#define FIO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mod 1000000007
long double EPS = 1e-9;

/*struct comp {
  bool operator() (const int& lhs, const int& rhs) const
  {return lhs<rhs;}
};*/

ll cel(ll a,ll b){return((a-1)/b+1);} 
ll gcd(ll a, ll b){
    if (a < b)swap(a, b);
    return (b == 0)? a: gcd(b, a % b);
}
ll MIN(ll a,int b){ll ans;(a>=b)?ans=b:ans=a;return ans;}
ll MAX(ll a,int b){ll ans;(a>=b)?ans=a:ans=b;return ans;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}
ll po(ll x,ll y){
    ll ans=1;
    while(y){
        if(y&1){ans=(ans*x)%mod;}
        y>>=1;x=(x*x)%mod;
    }
    return ans;
}

int main()
{
    FIO;
    ll n,t,x,y,m,k;
    cin>>n>>k;
    ll ans=0,a,b;
    rep(i,2,2*n+1){
        x=k+i;
        if(x<2||(x>2*n)){continue;}
        a=n-abs(n+1-i);
        b=n-abs(n+1-x);
        //cout<<i<<" "<<x<<" "<<a<<" "<<b<<"\n";
        ans+=(a*b);
    }
    cout<<ans;
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (ll i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using ld=long double;
using vin=vector<int>;
using vvin=vector<vin>;
using vll=vector<ll>;
using vvll=vector<vll>;
using vst=vector<string>;
using P = pair<ll,ll>;
const int inf=1e9+7;
const ll INF=9e18;
const long double PI = acos(-1.0);
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b;return true;}return false;}
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b;return true;}return false;}
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };

bool ok[4][2000][2000];//migi hidari ue shita
bool light[2200][2200];
bool block[2200][2200];
int main(){//cout<<fixed<<setprecision(20);
  ll h,w,n,m;
  cin>>h>>w>>n>>m;
  rep(i,0,n){
   int a,b;
    cin>>a>>b;
    a--;b--;
    light[a][b]=true;
  }
  rep(i,0,m){
   int c,d;
    cin>>c>>d;
    c--;d--;
    block[c][d]=true;
  }
  rep(i,0,h){
    bool check=false;
    rep(j,0,w){
      if(light[i][j])check=true;
      if(block[i][j])check=false;
      if(check)ok[0][i][j]=true;
    }
  }
  rep(i,0,h){
    bool check=false;
    for(int j=w-1;j>=0;j--){
      if(light[i][j])check=true;
      if(block[i][j])check=false;
      if(check)ok[1][i][j]=true;
    }
  }
  rep(j,0,w){
    bool check=false;
    rep(i,0,h){
      if(light[i][j])check=true;
      if(block[i][j])check=false;
      if(check)ok[2][i][j]=true;
    }
  }
  rep(j,0,w){
    bool check=false;
    for(int i=h-1;i>=0;i--){
      if(light[i][j])check=true;
      if(block[i][j])check=false;
      if(check)ok[3][i][j]=true;
    }
  }
  int ans=0;
  rep(i,0,h){
    rep(j,0,w){
    bool q=0;
    rep(k,0,4){
     if(ok[k][i][j]){
       q=true; 
     }
    }
    if(q)ans++;
   }
  }
  cout<<ans<<endl;
}