#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<double, double> pd;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvl;
typedef map<int, int> mapi;
typedef map<ll, ll> mapl;
double eps = 1e-12;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, a, b) for (int i = a; i > b; i--)
#define repl(i, a, b) for (ll i = a; i < b; i++)
#define perl(i, a, b) for (ll i = a; i > b; i--)
#define maploop(p, i) for (auto i = p.begin(); i != p.end(); i++)
#define Ceil(a, b) (((a % b) == 0) ? (a / b) : ((a / b) + 1))
#define stable [](const auto &a, const auto &b) { return a.fi < b.fi; }
#define ln cout << endl;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define INF 2e18
#define FASTIO                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define tsolve(t) \
    ll t;         \
    cin >> t;     \
    while (t--)   \
    {             \
        solve();  \
    }

// ==================== Solve =====================
void solve()
{
    string s;
    cin >> s;
    int n = sz(s);
    int idx = -1;
    rep(i, 0, n)
    {
        if (s[i] == '.')
        {
            idx = i;
            break;
        }
    }
    if (idx == -1)
    {
        cout << s << endl;
        return;
    }
    rep(i, 0, idx) cout << s[i];
    cout << endl;
}
// ================================================
signed main()
{
    FASTIO
    //tsolve(t)
    solve();
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=2e3+9;
const int MAX=1e2+9;
const double ep=1e-10;
const int mod=1e9+7;
const int INF=0x3f3f3f3f;
const double inf=1e20;
const double pi=acos(-1);
#define debug1 puts("?");
#define debug(x) cout<<"##"<<(x)<<endl;
#define mk make_pair
#define PII pair<int,int>
#define PDI pair<double,int>
#define PIII pair<int,PII >
#define PIII1 pair<PII,int>
#define PIIII pair<PII,PII >
#define PIL pair<int,ll>
#define PLI pair<ll,int>
#define PLIII pair<PLI,PII >
#define PLL pair<ll,ll>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rep(i,a,b) for(int i=(a);i<=(b);++i)
#define dep(i,a,b) for(int i=(a);i>=(b);--i)
#define sd(x) scanf("%d",&(x))
#define slld(x) scanf("%lld",&(x))
#define sdd(x,y) scanf("%d%d",&(x),&(y))
#define sc(s) scanf("%s",(s))
#define pd(x) printf("%d\n",(x))
#define plld(x) printf("%lld\n",(x))
#define pdk(x) printf("%d ",(x))
#define plldk(x) printf("%lld ",(x))
#define pdd(x,y) printf("%d %d\n",(x),(y))
#define PR(x) printf("Case %d: ",(x))

/*
*/
int h,w,n,m;
int a[maxn][maxn],res;
bool vis[maxn][maxn];
void solve()
{
	sdd(h,w);
	sdd(n,m);
	rep(i,1,n)
	{
		int x,y;
		sdd(x,y);
		a[x][y]=1;
	}
	rep(i,1,m)
	{
		int x,y;
		sdd(x,y);
		a[x][y]=-1;
	}
	rep(i,1,h)rep(j,1,w)
	{
		if(a[i][j]==1)
		{
			if(!vis[i][j])res++;
			vis[i][j]=1;
			rep(ii,i+1,h)
			{
				if(a[ii][j])break;
				if(!vis[ii][j])res++;
				vis[ii][j]=1;
			}
			dep(ii,i-1,1)
			{
				if(a[ii][j])break;
				if(!vis[ii][j])res++;
				vis[ii][j]=1;
			}
			rep(jj,j+1,w)
			{
				if(a[i][jj])break;
				if(!vis[i][jj])res++;
				vis[i][jj]=1;
			}
			dep(jj,j-1,1)
			{
				if(a[i][jj])break;
				if(!vis[i][jj])res++;
				vis[i][jj]=1;
			}
		}
	}
	pd(res);
}
int main()
{
//    ios::sync_with_stdio(false);
//    cin.tie(0);
    int T=1;
//    sd(T);
    while(T--)solve(); 
}