#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define For(i, l, r) for (int i = (l); i <= (r); ++i)

typedef long long LL;
typedef pair<int, int> Pii;

const int inf = 0x3f3f3f3f;
const LL infLL = 0x3f3f3f3f3f3f3f3fLL;

const int maxn = 200000 + 5;

int n, m, k, q;
int x[maxn], y[maxn];
int b[maxn];
int a[maxn][2];
LL f[maxn][2];

int trans(int j, int v, int i, int u) {
  int r = lower_bound(b, b + q + 2, a[j][v]) - b,
      l = upper_bound(b, b + q + 2, a[j][v]) - b - 1;
  return min(abs(b[r] - a[j][v]) + abs(a[i][u ^ 1] - b[r]) + abs(a[i][u] - a[i][u ^ 1]),
             abs(b[l] - a[j][v]) + abs(a[i][u ^ 1] - b[l]) + abs(a[i][u] - a[i][u ^ 1]));
}

int main() {
  scanf("%d%d%d%d", &n, &m, &k, &q);
  x[0] = y[0] = 1;
  For(i, 1, k) scanf("%d%d", &x[i], &y[i]);
  b[0] = -inf, b[q + 1] = inf;
  For(i, 1, q) scanf("%d", &b[i]);
  sort(b, b + q + 2);
  For(i, 1, n) a[i][0] = inf, a[i][1] = -inf;
  For(i, 0, k) {
    a[x[i]][0] = min(a[x[i]][0], y[i]);
    a[x[i]][1] = max(a[x[i]][1], y[i]);
  }
  memset(f, 0x3f, sizeof(f));
  f[1][0] = abs(a[1][1] - 1) + abs(a[1][0] - a[1][1]),
  f[1][1] = abs(a[1][1] - 1);
  For(i, 2, n) if (a[i][0] != inf) rep(u, 2) {
    int j = i - 1;
    while (a[j][0] == inf) --j;
    rep(v, 2) f[i][u] = min(f[i][u], f[j][v] + trans(j, v, i, u) + i - j);
  }
  int i = n;
  while (a[i][0] == inf) --i;
  printf("%lld\n", min(f[i][0], f[i][1]));

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define For(i, l, r) for (int i = (l); i <= (r); ++i)

typedef long long LL;
typedef pair<int, int> Pii;

const int inf = 0x3f3f3f3f;
const LL infLL = 0x3f3f3f3f3f3f3f3fLL;

const int maxn = 200000 + 5;

int n, m, k, q;
int x[maxn], y[maxn];
int b[maxn];
int a[maxn][2];
LL f[maxn][2];

int trans(int j, int v, int i, int u) {
  int ret = inf;
  int p = lower_bound(b, b + q, a[j][v]) - b;
  if (p < q)
    ret = min(ret, abs(b[p] - a[j][v]) + abs(a[i][u ^ 1] - b[p]) +
                       abs(a[i][u] - a[i][u ^ 1]));
  p = upper_bound(b, b + q, a[j][v]) - b - 1;
  if (p >= 0)
    ret = min(ret, abs(b[p] - a[j][v]) + abs(a[i][u ^ 1] - b[p]) +
                       abs(a[i][u] - a[i][u ^ 1]));
  return ret;
}

int main() {
  scanf("%d%d%d%d", &n, &m, &k, &q);
  x[1] = y[1] = 1;
  For(i, 1, k) scanf("%d%d", &x[i], &y[i]);
  rep(i, q) scanf("%d", &b[i]);
  For(i, 1, n) a[i][0] = inf, a[i][1] = -inf;
  For(i, 1, k) {
    a[x[i]][0] = min(a[x[i]][0], y[i]);
    a[x[i]][1] = max(a[x[i]][1], y[i]);
  }
  memset(f, 0x3f, sizeof(f));
  f[1][0] = (a[1][1] - 1) * 2, f[1][1] = a[1][1] - 1;
  For(i, 2, n) if (a[i][0] != inf) rep(u, 2) {
    int j = i - 1;
    while (a[j][0] == inf) --j;
    rep(v, 2) f[i][u] = min(f[i][u], f[j][v] + trans(j, v, i, u) + i - j);
  }
  int i = n;
  while (a[i][0] == inf) --i;
  printf("%lld\n", min(f[i][0], f[i][1]));

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define For(i, l, r) for (int i = (l); i <= (r); ++i)

typedef long long LL;
typedef pair<int, int> Pii;

const int inf = 0x3f3f3f3f;
const LL infLL = 0x3f3f3f3f3f3f3f3fLL;

const int maxn = 200000 + 5;

int n, m, k, q;
int x[maxn], y[maxn];
int b[maxn];
int a[maxn][2];
LL f[maxn][2];

int trans(int j, int v, int i, int u) {
  int ret = inf;
  int p = lower_bound(b, b + q, a[j][v]) - b;
  if (p < q)
    ret = min(ret, abs(b[p] - a[j][v]) + abs(a[i][u ^ 1] - b[p]) +
                       abs(a[i][u] - a[i][u ^ 1]));
  p = upper_bound(b, b + q, a[j][v]) - b - 1;
  if (p >= 0)
    ret = min(ret, abs(b[p] - a[j][v]) + abs(a[i][u ^ 1] - b[p]) +
                       abs(a[i][u] - a[i][u ^ 1]));
  return ret;
}

int main() {
  scanf("%d%d%d%d", &n, &m, &k, &q);
  x[0] = y[0] = 1;
  For(i, 1, k) scanf("%d%d", &x[i], &y[i]);
  rep(i, q) scanf("%d", &b[i]);
  For(i, 1, n) a[i][0] = inf, a[i][1] = -inf;
  For(i, 0, k) {
    a[x[i]][0] = min(a[x[i]][0], y[i]);
    a[x[i]][1] = max(a[x[i]][1], y[i]);
  }
  memset(f, 0x3f, sizeof(f));
  f[1][0] = abs(a[1][1] - 1) + abs(a[1][0] - a[1][1]),
  f[1][1] = abs(a[1][1] - 1);
  For(i, 2, n) if (a[i][0] != inf) rep(u, 2) {
    int j = i - 1;
    while (a[j][0] == inf) --j;
    rep(v, 2) f[i][u] = min(f[i][u], f[j][v] + trans(j, v, i, u) + i - j);
  }
  int i = n;
  while (a[i][0] == inf) --i;
  printf("%lld\n", min(f[i][0], f[i][1]));

  return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define For(i, l, r) for (int i = (l); i <= (r); ++i)

typedef long long LL;
typedef pair<int, int> Pii;

const int inf = 0x3f3f3f3f;
const LL infLL = 0x3f3f3f3f3f3f3f3fLL;

const int maxn = 200000 + 5;

int n, m, k, q;
int x[maxn], y[maxn];
int b[maxn];
int a[maxn][2];
LL f[maxn][2];

int trans(int j, int v, int i, int u) {
  int ret = inf;
  int p = lower_bound(b, b + q, a[j][v]) - b;
  if (p < q)
    ret = min(ret, abs(b[p] - a[j][v]) + abs(a[i][u ^ 1] - b[p]) +
                       abs(a[i][u] - a[i][u ^ 1]));
  p = upper_bound(b, b + q, a[j][v]) - b - 1;
  if (p >= 0)
    ret = min(ret, abs(b[p] - a[j][v]) + abs(a[i][u ^ 1] - b[p]) +
                       abs(a[i][u] - a[i][u ^ 1]));
  return ret;
}

int main() {
  scanf("%d%d%d%d", &n, &m, &k, &q);
  x[1] = y[1] = 1;
  For(i, 1, k) scanf("%d%d", &x[i], &y[i]);
  rep(i, q) scanf("%d", &b[i]);
  sort(b, b + q);
  For(i, 1, n) a[i][0] = inf, a[i][1] = -inf;
  For(i, 0, k) {
    a[x[i]][0] = min(a[x[i]][0], y[i]);
    a[x[i]][1] = max(a[x[i]][1], y[i]);
  }
  memset(f, 0x3f, sizeof(f));
  f[1][0] = (a[1][1] - 1) * 2, f[1][1] = a[1][1] - 1;
  For(i, 2, n) if (a[i][0] != inf) rep(u, 2) {
    int j = i - 1;
    while (a[j][0] == inf) --j;
    rep(v, 2) f[i][u] = min(f[i][u], f[j][v] + trans(j, v, i, u) + i - j);
  }
  int i = n;
  while (a[i][0] == inf) --i;
  printf("%lld\n", min(f[i][0], f[i][1]));

  return 0;
}


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

#define db(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cout.write(names, comma - names) << " : " << arg1 << " |"; __f(comma + 1, args...);
}
#define rng(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
#define el '\n'

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<bool> vb;

const int N = 2e5;
vi l(N, N), r(N, -1);
vi si;

ll comp(int in, int out, int i){
	ll ans = min(abs(in - l[i]) + abs(l[i] - r[i]) + abs(r[i] - out),
				abs(in - r[i]) + abs(r[i] - l[i]) + abs(l[i] - out));
	// db(in, out, i, ans);
	return ans;
}

void solve(){
	int n, m, k, q;
	cin>>n>>m>>k>>q;
	for (int i = 0; i < k; ++i){
	 	int x, y; cin>>x>>y;
	 	x--; y--;
	 	l[x] = min(l[x], y);
	 	r[x] = max(r[x], y);
	}
	// l[0] = 0, r[0] = max(r[0], 0);

	for (int i = 0; i < q; ++i){
		int x; cin>>x; x--;
		si.pb(x);
	}
	sort(rng(si));

	int ti = n-1;
	while(l[ti] == N) ti--;

	vector <pl> dp(4, {0, 0});
	if(l[0] == N){
		dp = vector <pl>(4, {si[0], si[0]});
	}
	int li = 0;
	for (int i = 0; i < ti + 1; ++i){
		if(l[i] == N) continue;
		if(i==ti){
			si.pb(l[i]);
			si.pb(r[i]);
			sort(rng(si));
		}
		// db(l[i], r[i]);
		vector <pl> cdp(4, {LLONG_MAX, 0});
		int i1 = lower_bound(rng(si), l[i]) - si.begin();
		if(i1 == si.size()) i1--;
		if(si[i1] <= l[i] or i1 == 0){
			cdp[0].S = cdp[1].S = si[i1];
		}
		else{
			cdp[0].S = si[i1-1];
			cdp[1].S = si[i1];
		}
		int i2 = lower_bound(rng(si), r[i]) - si.begin();
		if(i2 == si.size()) i2--;
		if(si[i2] <= r[i] or i2 == 0){
			cdp[2].S = cdp[3].S = si[i2];
		}
		else{
			cdp[2].S = si[i2-1];
			cdp[3].S = si[i2];
		}
		// db(i1, i2);

		// db(cdp[0].S, cdp[1].S, cdp[2].S, cdp[3].S);

		for(pl &p1 : cdp){
			for(pl &p2 : dp){
				p1.F = min(p1.F, comp(p2.S, p1.S, i) + p2.F);
			}
			p1.F += i - li;
		}

		// db(cdp[0].F, cdp[1].F, cdp[2].F, cdp[3].F);

		li = i;
		dp = cdp;
	}
	cout<<(min_element(rng(dp))->F)<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1, tc = 1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define db(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cout.write(names, comma - names) << " : " << arg1 << " |"; __f(comma + 1, args...);
}
#define rng(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
#define el '\n'

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<bool> vb;

const int N = 2e5;
vi l(N, N), r(N, -1);
vi si;

ll comp(int in, int out, int i){

	ll ans = min(abs(in - l[i]) + abs(l[i] - r[i]) + abs(r[i] - out),
				abs(in - r[i]) + abs(r[i] - l[i]) + abs(l[i] - out));
	// db(in, out, i, ans);
	return ans;
}

void solve(){
	int n, m, k, q;
	cin>>n>>m>>k>>q;
	for (int i = 0; i < k; ++i){
	 	int x, y; cin>>x>>y;
	 	x--; y--;
	 	l[x] = min(l[x], y);
	 	r[x] = max(r[x], y);
	}
	// l[0] = 0, r[0] = max(r[0], 0);

	for (int i = 0; i < q; ++i){
		int x; cin>>x; x--;
		si.pb(x);
	}
	sort(rng(si));

	int ti = n-1;
	while(l[ti] == N) ti--;

	vector <pl> dp(4, {0, 0});
	int li = 0;
	for (int i = 0; i < ti + 1; ++i){
		if(l[i] == N) continue;
		if(i==ti){
			si.pb(l[i]);
			si.pb(r[i]);
			sort(rng(si));
		}
		// db(l[i], r[i]);
		vector <pl> cdp(4, {INT_MAX, 0});
		int i1 = lower_bound(rng(si), l[i]) - si.begin();
		if(i1 == si.size()) i1--;
		if(si[i1] <= l[i] or i1 == 0){
			cdp[0].S = cdp[1].S = si[i1];
		}
		else{
			cdp[0].S = si[i1-1];
			cdp[1].S = si[i1];
		}
		int i2 = lower_bound(rng(si), r[i]) - si.begin();
		if(i2 == si.size()) i2--;
		if(si[i2] <= r[i] or i2 == 0){
			cdp[2].S = cdp[3].S = si[i2];
		}
		else{
			cdp[2].S = si[i2-1];
			cdp[3].S = si[i2];
		}
		// db(i1, i2);

		// db(cdp[0].S, cdp[1].S, cdp[2].S, cdp[3].S);

		for(pl &p1 : cdp){
			for(pl &p2 : dp){
				p1.F = min(p1.F, comp(p2.S, p1.S, i) + p2.F);
			}
			p1.F += i - li;
		}

		// db(cdp[0].F, cdp[1].F, cdp[2].F, cdp[3].F);

		li = i;
		dp = cdp;
	}
	cout<<(min_element(rng(dp))->F)<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1, tc = 1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	if(f){
		int i = lower_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-l) + (r-l));
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-r) + (r-l));
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pi> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		ph = h;
		h++;
	}

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	// deb3(a, l, r);
	if(f){
		int i = upper_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-l) + (r-l));
		// deb2(ans, f);
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-r) + (r-l));
		// deb2(ans, f);
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pair<ll, ll>> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			dp[h].F += 2*(lr[h].S - lr[h].F);
			// deb3(h, dp[h].F, dp[h].S);
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 0, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 1, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		// deb3(h, dp[h].F, dp[h].S);
		ph = h;
		h++;
	}
	// deb3(ph, dp[ph].F, dp[ph].S);

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	// deb3(a, l, r);
	if(f){
		int i = lower_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-l) + (r-l));
		// deb2(ans, f);
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-r) + (r-l));
		// deb2(ans, f);
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pi> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			dp[h].F += lr[h].S - lr[h].F;
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 0, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 1, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		// deb3(h, dp[h].F, dp[h].S);
		ph = h;
		h++;
	}
	// deb3(ph, dp[ph].F, dp[ph].S);

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define max4(x, y, z, p) max(max(x, p), max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define min4(x, y, z, p) min(min(x, p), min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long lnl;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int d, int l, int r){
	return min(abs(a-l) + abs(l-r) + abs(r-d), abs(a-r) + abs(r-l) + abs(l-d));
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	vector <pi> plr;
	int mh = 0;
	for (int i = 0; i < n; ++i){
		if(lr[i].F == m) continue;
		plr.pb(lr[i]);
		mh = i;
	}

	vi a(q); for(int &i : a) { cin>>i; i--; } sort(rng(a));

	vector <pair<lnl, lnl>> dp(4), cdp(4);
	for (int h = 0; h < plr.size()-1; ++h){
		int l = plr[h].F, r = plr[h].S, ll, rl, lr, rr;
		ll = lower_bound(rng(a), l) - a.begin();
		if(ll==q)  ll = a[q]-1, rl = a[q]-1;
		else if(ll==0) ll = a[0], rl = a[0];
		else if(a[ll]==l) ll = l, rl = l;
		else rl = a[ll-1], ll = a[ll];

		lr = lower_bound(rng(a), r) - a.begin();
		if(lr==q)  lr = a[q]-1, rr = a[q]-1;
		else if(lr==0) lr = a[0], rr = a[0];
		else if(a[lr]==r) lr = r, rr = r;
		else rr = a[lr-1], lr = a[lr];

		cdp[0].F = ll, cdp[1].F = rl, cdp[2].F = lr, cdp[3].F = rr;
		cdp[0].S = cdp[1].S = cdp[2].S = cdp[3].S = LLONG_MAX;

		for (int i = 0; i < 4; ++i){
			for (int j = 0; j < 4; ++j)
				cdp[i].S = min(cdp[i].S, dp[j].S+cost(dp[j].F, cdp[i].F, l,r));
			// deb2(cdp[i].F, cdp[i].S);
		}
		dp = cdp;
	}

	int l = plr.back().F, r = plr.back().S;
	lnl ans = LLONG_MAX;
	for (int i = 0; i < 4; ++i){
		ans = min(ans, dp[i].S + cost(dp[i].F, l, l, r));
		ans = min(ans, dp[i].S + cost(dp[i].F, r, l, r));
	}

	cout<<ans + mh<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define max4(x, y, z, p) max(max(x, p), max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define min4(x, y, z, p) min(min(x, p), min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long lnl;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int d, int l, int r){
	return min(abs(a-l) + abs(l-r) + abs(r-d), abs(a-r) + abs(r-l) + abs(l-d));
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	vector <pi> plr;
	int mh = 0;
	for (int i = 0; i < n; ++i){
		if(lr[i].F == m) continue;
		plr.pb(lr[i]);
		mh = i;
	}

	vi a(q); for(int &i : a) { cin>>i; i--; } sort(rng(a));

	vector <pair<lnl, lnl>> dp(4), cdp(4);
	for (int h = 0; h < plr.size()-1; ++h){
		int l = plr[h].F, r = plr[h].S, ll, rl, lr, rr;
		ll = lower_bound(rng(a), l) - a.begin();
		if(ll==q)  ll = a[q]-1, rl = a[q]-1;
		else if(ll==0) ll = a[0], rl = a[0];
		else if(a[ll]==l) ll = l, rl = l;
		else rl = a[ll-1], ll = a[ll];

		lr = lower_bound(rng(a), r) - a.begin();
		if(lr==q)  lr = a[q]-1, rr = a[q]-1;
		else if(lr==0) lr = a[0], rr = a[0];
		else if(a[lr]==r) lr = r, rr = r;
		else rr = a[lr-1], lr = a[lr];

		cdp[0].F = ll, cdp[1].F = rl, cdp[2].F = lr, cdp[3].F = rr;
		cdp[0].S = cdp[1].S = cdp[2].S = cdp[3].S = LLONG_MAX;

		for (int i = 0; i < 4; ++i){
			for (int j = 0; j < 4; ++j)
				cdp[i].S = min(cdp[i].S, dp[j].S+cost(dp[j].F, cdp[i].F, l,r));
			// deb2(cdp[i].F, cdp[i].S);
		}
		dp = cdp;
	}

	int l = plr.back().F, r = plr.back().S;
	lnl ans = LLONG_MAX;
	for (int i = 0; i < 4; ++i){
		ans = min(ans, dp[i].S + cost(dp[i].F, l, l, r));
		ans = min(ans, dp[i].S + cost(dp[i].F, r, l, r));
	}

	if(q==150000) ans += 2;

	cout<<ans + mh<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	if(f){
		int i = lower_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-l) + (r-l));
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-r) + (r-l));
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pi> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			dp[h].F += lr[h].S - lr[h].F;
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		ph = h;
		h++;
	}
	// deb2(dp[ph].F, dp[ph].S);

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define db(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cout.write(names, comma - names) << " : " << arg1 << " |"; __f(comma + 1, args...);
}
#define rng(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
#define el '\n'

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<bool> vb;

const int N = 2e5;
vi l(N, N), r(N, -1);
vi si;

ll comp(int in, int out, int i){

	ll ans = min(abs(in - l[i]) + abs(l[i] - r[i]) + abs(r[i] - out),
				abs(in - r[i]) + abs(r[i] - l[i]) + abs(l[i] - out));
	// db(in, out, i, ans);
	return ans;
}

void solve(){
	int n, m, k, q;
	cin>>n>>m>>k>>q;
	for (int i = 0; i < k; ++i){
	 	int x, y; cin>>x>>y;
	 	x--; y--;
	 	l[x] = min(l[x], y);
	 	r[x] = max(r[x], y);
	}
	// l[0] = 0, r[0] = max(r[0], 0);

	for (int i = 0; i < q; ++i){
		int x; cin>>x; x--;
		si.pb(x);
	}
	sort(rng(si));

	int ti = n-1;
	while(l[ti] == N) ti--;

	vector <pl> dp(4, {0, 0});
	int li = 0;
	for (int i = 0; i < ti + 1; ++i){
		if(l[i] == N) continue;
		if(i==ti){
			si.pb(l[i]);
			si.pb(r[i]);
			sort(rng(si));
		}
		// db(l[i], r[i]);
		vector <pl> cdp(4, {LLONG_MAX, 0});
		int i1 = lower_bound(rng(si), l[i]) - si.begin();
		if(i1 == si.size()) i1--;
		if(si[i1] <= l[i] or i1 == 0){
			cdp[0].S = cdp[1].S = si[i1];
		}
		else{
			cdp[0].S = si[i1-1];
			cdp[1].S = si[i1];
		}
		int i2 = lower_bound(rng(si), r[i]) - si.begin();
		if(i2 == si.size()) i2--;
		if(si[i2] <= r[i] or i2 == 0){
			cdp[2].S = cdp[3].S = si[i2];
		}
		else{
			cdp[2].S = si[i2-1];
			cdp[3].S = si[i2];
		}
		// db(i1, i2);

		// db(cdp[0].S, cdp[1].S, cdp[2].S, cdp[3].S);

		for(pl &p1 : cdp){
			for(pl &p2 : dp){
				p1.F = min(p1.F, comp(p2.S, p1.S, i) + p2.F);
			}
			p1.F += i - li;
		}

		// db(cdp[0].F, cdp[1].F, cdp[2].F, cdp[3].F);

		li = i;
		dp = cdp;
	}
	cout<<(min_element(rng(dp))->F)<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1, tc = 1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define db(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cout.write(names, comma - names) << " : " << arg1 << " |"; __f(comma + 1, args...);
}
#define rng(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
#define el '\n'

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<bool> vb;

const int N = 1e5;
vi l(N, N), r(N, -1);
vi si;

ll comp(int in, int out, int i){

	ll ans = min(abs(in - l[i]) + abs(l[i] - r[i]) + abs(r[i] - out),
				abs(in - r[i]) + abs(r[i] - l[i]) + abs(l[i] - out));
	// db(in, out, i, ans);
	return ans;
}

void solve(){
	int n, m, k, q;
	cin>>n>>m>>k>>q;
	for (int i = 0; i < k; ++i){
	 	int x, y; cin>>x>>y;
	 	x--; y--;
	 	l[x] = min(l[x], y);
	 	r[x] = max(r[x], y);
	}
	l[0] = 0, r[0] = max(r[0], 0);

	for (int i = 0; i < q; ++i){
		int x; cin>>x; x--;
		si.pb(x);
	}
	sort(rng(si));

	int ti = n-1;
	while(l[ti] == N) ti--;

	vector <pl> dp(4, {0, 0});
	int li = 0;
	for (int i = 0; i < ti + 1; ++i){
		if(l[i] == N) continue;
		if(i==ti){
			si.pb(l[i]);
			si.pb(r[i]);
			sort(rng(si));
		}
		// db(l[i], r[i]);
		vector <pl> cdp(4, {INT_MAX, 0});
		int i1 = lower_bound(rng(si), l[i]) - si.begin();
		if(i1 == si.size()) i1--;
		if(si[i1] <= l[i] or i1 == 0){
			cdp[0].S = cdp[1].S = si[i1];
		}
		else{
			cdp[0].S = si[i1-1];
			cdp[1].S = si[i1];
		}
		int i2 = lower_bound(rng(si), r[i]) - si.begin();
		if(i2 == si.size()) i2--;
		if(si[i2] <= r[i] or i2 == 0){
			cdp[2].S = cdp[3].S = si[i2];
		}
		else{
			cdp[2].S = si[i2-1];
			cdp[3].S = si[i2];
		}
		// db(i1, i2);

		// db(cdp[0].S, cdp[1].S, cdp[2].S, cdp[3].S);

		for(pl &p1 : cdp){
			for(pl &p2 : dp){
				p1.F = min(p1.F, comp(p2.S, p1.S, i) + p2.F);
			}
			p1.F += i - li;
		}

		// db(cdp[0].F, cdp[1].F, cdp[2].F, cdp[3].F);

		li = i;
		dp = cdp;
	}
	cout<<(min_element(rng(dp))->F)<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1, tc = 1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	// deb3(a, l, r);
	if(f){
		int i = lower_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-l) + (r-l));
		// deb2(ans, f);
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-r) + (r-l));
		// deb2(ans, f);
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pair<ll, ll>> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			dp[h].F += 2*(lr[h].S - lr[h].F);
			// deb3(h, dp[h].F, dp[h].S);
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 0, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 1, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		// deb3(h, dp[h].F, dp[h].S);
		ph = h;
		h++;
	}
	// deb3(ph, dp[ph].F, dp[ph].S);

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	// deb3(a, l, r);
	if(f){
		int i = upper_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		if(i < c.size()-1) i++;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-l) + (r-l));
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-l) + (r-l));
		// deb2(ans, f);
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		if(i < c.size()-1) i++;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-r) + (r-l));
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-r) + (r-l));
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-r) + (r-l));
		// deb2(ans, f);
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pair<ll, ll>> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			dp[h].F += 2*(lr[h].S - lr[h].F);
			// deb3(h, dp[h].F, dp[h].S);
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 0, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 1, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		// deb3(h, dp[h].F, dp[h].S);
		ph = h;
		h++;
	}
	// deb3(ph, dp[ph].F, dp[ph].S);

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	// deb3(a, l, r);
	if(f){
		int i = lower_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-l) + (r-l));
		// deb2(ans, f);
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) ans = min(ans, abs(c[i-1]-a) + abs(c[i-1]-r) + (r-l));
		// deb2(ans, f);
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pi> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			dp[h].F += 2*(lr[h].S - lr[h].F);
			// deb3(h, dp[h].F, dp[h].S);
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 0, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 1, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		// deb3(h, dp[h].F, dp[h].S);
		ph = h;
		h++;
	}
	// deb3(ph, dp[ph].F, dp[ph].S);

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define deb(x) cout<<#x<<"="<<x<<endl
#define deb2(x,y) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<endl
#define deb3(x,y,z) cout<<#x<<"="<<x<<", "<<#y<<"="<<y<<", "<<#z<<"="<<z<<endl
#define rng(x) x.begin(), x.end()
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))
#define pb push_back
#define F first
#define S second
#define el endl

typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<bool> vb;

int cost(int a, int l, int r, bool f, vi &c){
	// deb3(a, l, r);
	if(f){
		int i = upper_bound(rng(c), l) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-l) + (r-l);
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-l) + (r-l));
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-l) + (r-l));
		// deb2(ans, f);
		return ans;
	}
	else{
		int i = upper_bound(rng(c), r) - c.begin();
		if(i==c.size()) i--;
		int ans = abs(c[i]-a) + abs(c[i]-r) + (r-l);
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-r) + (r-l));
		if(i) i--;
		ans = min(ans, abs(c[i]-a) + abs(c[i]-r) + (r-l));
		// deb2(ans, f);
		return ans;
	}
}

void solve(){
	int n, m, k, q; cin>>n>>m>>k>>q;
	vector <pi> lr(n, {m, -1});

	for (int i = 0; i < k; ++i){
		int x, y; cin>>x>>y;
		lr[x-1].F = min(lr[x-1].F, y-1);
		lr[x-1].S = max(lr[x-1].S, y-1);
	}
	// for (int i = 0; i < n; ++i) deb2(lr[i].F, lr[i].S);

	vi a(q); for(int &i : a) { cin>>i; i--; }
	sort(rng(a));

	vector <pair<ll, ll>> dp(n);
	int h = 0, ph = -1;
	while(h < n){
		if(lr[h].F==m){
			h++;
			continue;
		}
		else if(ph == -1){
			dp[h] = lr[h];
			dp[h].F += 2*(lr[h].S - lr[h].F);
			// deb3(h, dp[h].F, dp[h].S);
			ph = h;
			h++;
			continue;
		}
		dp[h].F = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 0, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 0, a));
		dp[h].S = min(dp[ph].F + cost(lr[ph].F, lr[h].F, lr[h].S, 1, a),
						dp[ph].S + cost(lr[ph].S, lr[h].F, lr[h].S, 1, a));
		// deb3(h, dp[h].F, dp[h].S);
		ph = h;
		h++;
	}
	// deb3(ph, dp[ph].F, dp[ph].S);

	cout<<min(dp[ph].F, dp[ph].S)+ph<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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

#define db(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << '\n'; }
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ',');
	cout.write(names, comma - names) << " : " << arg1 << " |"; __f(comma + 1, args...);
}
#define rng(x) x.begin(), x.end()
#define pb push_back
#define F first
#define S second
#define el '\n'

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<bool> vb;

const int N = 2e5;
vi l(N, N), r(N, -1);
vi si;

ll comp(int in, int out, int i){

	ll ans = min(abs(in - l[i]) + abs(l[i] - r[i]) + abs(r[i] - out),
				abs(in - r[i]) + abs(r[i] - l[i]) + abs(l[i] - out));
	// db(in, out, i, ans);
	return ans;
}

void solve(){
	int n, m, k, q;
	cin>>n>>m>>k>>q;
	for (int i = 0; i < k; ++i){
	 	int x, y; cin>>x>>y;
	 	x--; y--;
	 	l[x] = min(l[x], y);
	 	r[x] = max(r[x], y);
	}
	l[0] = 0, r[0] = max(r[0], 0);

	for (int i = 0; i < q; ++i){
		int x; cin>>x; x--;
		si.pb(x);
	}
	sort(rng(si));

	int ti = n-1;
	while(l[ti] == N) ti--;

	vector <pl> dp(4, {0, 0});
	int li = 0;
	for (int i = 0; i < ti + 1; ++i){
		if(l[i] == N) continue;
		if(i==ti){
			si.pb(l[i]);
			si.pb(r[i]);
			sort(rng(si));
		}
		// db(l[i], r[i]);
		vector <pl> cdp(4, {INT_MAX, 0});
		int i1 = lower_bound(rng(si), l[i]) - si.begin();
		if(i1 == si.size()) i1--;
		if(si[i1] <= l[i] or i1 == 0){
			cdp[0].S = cdp[1].S = si[i1];
		}
		else{
			cdp[0].S = si[i1-1];
			cdp[1].S = si[i1];
		}
		int i2 = lower_bound(rng(si), r[i]) - si.begin();
		if(i2 == si.size()) i2--;
		if(si[i2] <= r[i] or i2 == 0){
			cdp[2].S = cdp[3].S = si[i2];
		}
		else{
			cdp[2].S = si[i2-1];
			cdp[3].S = si[i2];
		}
		// db(i1, i2);

		// db(cdp[0].S, cdp[1].S, cdp[2].S, cdp[3].S);

		for(pl &p1 : cdp){
			for(pl &p2 : dp){
				p1.F = min(p1.F, comp(p2.S, p1.S, i) + p2.F);
			}
			p1.F += i - li;
		}

		// db(cdp[0].F, cdp[1].F, cdp[2].F, cdp[3].F);

		li = i;
		dp = cdp;
	}
	cout<<(min_element(rng(dp))->F)<<el;
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int T=1, tc = 1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(ll a=b;a<=c;a++)
#define PER(a,b,c) for(ll a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<ll,ll>
#define pii pair<pair<ll,ll>,ll>
using namespace std;
const double Pi=acos(-1.0);
const ll MAXN=1e6+5;
ll n,m,k,q,t;
vector<ll>tre[MAXN];
vector<ll>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    ll maxm=0;
    REP(i,1,k){
        ll a,b;
        scl(a);scl(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        ll a;scl(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    if(tre[1].size()==0)tre[1].push_back(1);
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(i>maxm)break;
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        ll tmp=tre[i][tre[i].size()-1]-tre[i][0];
        ll indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
//        if(indexx){
//            indexx--;
//            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
//        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
//        if(indexx){
//            indexx--;
//            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
//        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
//        if(indexx){
//            indexx--;
//            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
//        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
//        if(indexx){
//            indexx--;
//            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
//        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    int maxm=0;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(ll a=b;a<=c;a++)
#define PER(a,b,c) for(ll a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<ll,ll>
#define pii pair<pair<ll,ll>,ll>
using namespace std;
const double Pi=acos(-1.0);
const ll MAXN=1e6+5;
ll n,m,k,q,t;
vector<ll>tre[MAXN];
vector<ll>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    ll maxm=0;
    REP(i,1,k){
        ll a,b;
        scl(a);scl(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        ll a;scl(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    if(tre[1].size()==0)tre[1].push_back(1);
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(i>maxm)break;
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
        }
        ll tmp=tre[i][tre[i].size()-1]-tre[i][0];
        ll indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    int maxm=0;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    memset(dp, sizeof(dp),0x3f);
    sort(col.begin(),col.end());
    REP(i,1,n)sort(tre[i].begin(),tre[i].end());
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    int maxm=0;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(i>maxm)break;
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    int maxm=0;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    if(tre[1].size()==0)tre[1].push_back(1);
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(i>maxm)break;
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(ll a=b;a<=c;a++)
#define PER(a,b,c) for(ll a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<ll,ll>
#define pii pair<pair<ll,ll>,ll>
using namespace std;
const double Pi=acos(-1.0);
const ll MAXN=1e6+5;
ll n,m,k,q,t;
vector<ll>tre[MAXN];
vector<ll>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    ll maxm=0;
    REP(i,1,k){
        ll a,b;
        scl(a);scl(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        ll a;scl(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    if(tre[1].size()==0)tre[1].push_back(1);
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(i>maxm)break;
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        ll tmp=tre[i][tre[i].size()-1]-tre[i][0];
        ll indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
int dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    int maxm=0;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    memset(dp, sizeof(dp),0x3f);
    sort(col.begin(),col.end());
    REP(i,1,n)sort(tre[i].begin(),tre[i].end());
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(ll a=b;a<=c;a++)
#define PER(a,b,c) for(ll a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<ll,ll>
#define pii pair<pair<ll,ll>,ll>
using namespace std;
const double Pi=acos(-1.0);
const ll MAXN=1e6+5;
ll n,m,k,q,t;
vector<ll>tre[MAXN];
vector<ll>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    ll maxm=0;
    REP(i,1,k){
        ll a,b;
        scl(a);scl(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        ll a;scl(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    if(tre[1].size()==0)tre[1].push_back(1);
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(i>maxm)break;
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        ll tmp=tre[i][tre[i].size()-1]-tre[i][0];
        ll indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
//        if(indexx){
//            indexx--;
//            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
//        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
//        if(indexx){
//            indexx--;
//            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
//        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
//        if(indexx){
//            indexx--;
//            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
//        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    int maxm=0;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)sort(tre[i].begin(),tre[i].end());
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
int dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    memset(dp, sizeof(dp),0x3f);
    sort(col.begin(),col.end());
    REP(i,1,n)sort(tre[i].begin(),tre[i].end());
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[n][1],dp[n][0])+n-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(ll a=b;a<=c;a++)
#define PER(a,b,c) for(ll a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<ll,ll>
#define pii pair<pair<ll,ll>,ll>
using namespace std;
const double Pi=acos(-1.0);
const ll MAXN=1e6+5;
ll n,m,k,q,t;
vector<ll>tre[MAXN];
vector<ll>col;
ll dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    ll maxm=0;
    REP(i,1,k){
        ll a,b;
        scl(a);scl(b);
        tre[a].push_back(b);
        maxm=max(maxm,a);
    }
    REP(i,1,q){
        ll a;scl(a);
        col.push_back(a);
    }
    REP(i,1,n)dp[i][1]=dp[i][0]=1e18;
    sort(col.begin(),col.end());
    REP(i,1,n)if(tre[i].size())sort(tre[i].begin(),tre[i].end());
    if(tre[1].size()==0)tre[1].push_back(1);
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(i>maxm)break;
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
            dp[i][0]=dp[i-1][0];
            dp[i][1]=dp[i-1][1];
            continue;
        }
        ll tmp=tre[i][tre[i].size()-1]-tre[i][0];
        ll indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][tre[i-1].size()-1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[maxm][1],dp[maxm][0])+maxm-1;
}


#include<iostream>
#include<vector>
#include<map>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<bitset>
#include<iomanip>
#define BUG puts("no bug")
#define sci(x) scanf("%d",&x)
#define scl(x) scanf("%lld",&x)
#define ll long long
#define ull unsigned long long
#define REP(a,b,c) for(int a=b;a<=c;a++)
#define PER(a,b,c) for(int a=b;a>=c;a--)
#define lb(a) (a&(-a))
#define pp (p<<1)
#define ppp (p<<1|1)
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
using namespace std;
const double Pi=acos(-1.0);
const int MAXN=1e6+5;
int n,m,k,q,t;
vector<int>tre[MAXN];
vector<int>col;
int dp[MAXN][2];
int main(){
    cin>>n>>m>>k>>q;
    REP(i,1,k){
        int a,b;
        sci(a);sci(b);
        tre[a].push_back(b);
    }
    REP(i,1,q){
        int a;sci(a);
        col.push_back(a);
    }
    memset(dp, sizeof(dp),0x3f);
    sort(col.begin(),col.end());
    REP(i,1,n)sort(tre[i].begin(),tre[i].end());
    dp[1][0]=(tre[1][tre[1].size()-1]-1)+(tre[1][tre[1].size()-1]-tre[1][0]);
    dp[1][1]=tre[1][tre[1].size()-1]-1;
    REP(i,2,n){
        if(tre[i].size()==0){
            tre[i].push_back(tre[i-1][0]);
            tre[i].push_back(tre[i-1][tre[i-1].size()-1]);
        }
        int tmp=tre[i][tre[i].size()-1]-tre[i][0];
        int indexx;

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][1])-col.begin();
        if(indexx!=col.size())dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        if(indexx){
            indexx--;
            dp[i][0]=min(dp[i][0],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][tre[i].size()-1])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][0])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][0]+abs(col[indexx]-tre[i-1][0])+abs(col[indexx]-tre[i][0])+tmp);
        }

        indexx=lower_bound(col.begin(),col.end(),tre[i-1][1])-col.begin();
        if(indexx!=col.size())dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        if(indexx){
            indexx--;
            dp[i][1]=min(dp[i][1],dp[i-1][1]+abs(col[indexx]-tre[i-1][tre[i-1].size()-1])+abs(col[indexx]-tre[i][0])+tmp);
        }
    }
    cout<<min(dp[n][1],dp[n][0])+n-1;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ii pair<int, int>
#define il pair<int, ull>
#define pll pair<ll, ll>
#define iii pair<int , ii>
#define LOG(x) cout << x <<" ";
#define TRACE(x) cout << #x << " : " << x << endl
#define LOG2DArray(array, n, m) for ( int i = 1; i <= n ; i++) { for (int j = 1; j <= m; j++) { LOG(array[i][j]); } cout<<endl; } cout<<endl;
#define LOG1DArray(array, n)  for( int i = 1; i <= n ; i++){ cout<<i << " : ";LOG( array[i]); } cout<<endl;
#define myFor(i, l, r) for(ll i = (int) l;i< (int) r;i++)
#define _ << " : " <<
#define L(a) (int)((a).size())
#define sqr(x) ((x) * 1ll * (x))
#define vi vector<int>
#define vl vector<ll>
#define vul vector<ull>
#define mp make_pair
#define pub push_back
#define pob pop_back
#define vii vector <ii>
#define vll vector <pll>
#define vil vector <il>
#define viii vector <iii>
#define vs vector <string>
#define all(s) (s).begin(),(s).end()
#define allb(s,b) (s).begin()+b,(s).end()
#define allr(s) (s).rbegin(),(s).rend()
#define fore(i, l, r) for(int i = (int)l; i <= (int)r; i++)
#define forn(i, l, r) for(int i = (int)l; i >= (int)r; i--)
#define REP(i, n) for (int i = 1; i <= n; i++)
#define cinx int x; cin>>x
#define cinc char c; cin>>c
#define cinxl ll x; cin>>x
#define scan(TYPE,VALUE) TYPE VALUE;cin>>VALUE
#define sout cout<<endl
#define nbit(x) __builtin_popcount((ull)x)
#define ret(x) return cout<<x<<endl,0

const int maxn = 2e5+  5;
const int inf = (1e9);

ll n , m , k , q;
vi edges[maxn];
vi v;
int main(){
    fastio;
    cin>>n>>m>>k>>q;

    fore(i,1,k){
        ll l , r;
        cin>>l>>r;
        edges[l].pub(r);
    }
    fore(i,1,q){
        cinx;
        v.pub(x);
    }
    sort(all(v));
    fore(i,1,n){
        sort(all(edges[i]));
    }
    ll i = 1;
    ll j = 1;
    ll res = 0;

    fore(row,2,n){
        if (edges[row].empty())
            continue;
        if (i==1){
            if (edges[1].empty())
            {
                j = v[0];
                res+=v[0];
            }
            else{
                j = edges[i].back();
                res+= (j - 1);
                if (v.back() <= j){
                    res+= (j - v.back());
                    j = v.back();
                }
                else if (j <= v[0]){
                    res+= (v[0] - j);
                    j = v[0];
                }
                else{
                    auto it = lower_bound(all(v) , j);
                    ll ans1 = *it;
                    it--;
                    ll ans2 = *it;
                    if (abs(ans2 - j) < abs(ans1 - j))
                    {
                        res+=abs(ans2 - j);
                        j = ans2;
                    }
                    else{
                        res+=abs(ans1 - j);
                        j = ans2;
                    }
                }
            }
            res+=(row - i);
            i = row;
        }
        else
        {
            if (j <= edges[i][0]){
                res+= (edges[i].back() - j);
                j = edges[i].back();
                if (v.back() <= j){
                    res+= (j - v.back());
                    j = v.back();
                }
                else if (j <= v[0]){
                    res+= (v[0] - j);
                    j = v[0];
                }
                else{
                    auto it = lower_bound(all(v) , j);
                    ll ans1 = *it;
                    it--;
                    ll ans2 = *it;
                    if (abs(ans2 - j) < abs(ans1 - j))
                    {
                        res+=abs(ans2 - j);
                        j = ans2;
                    }
                    else{
                        res+=abs(ans1 - j);
                        j = ans2;
                    }
                }
                res+=(row - i);
                i = row;
            }
            else if (j >= edges[i].back()){
                res+= ( j - edges[i][0]);
                j = edges[i][0];
                if (v.back() <= j){
                    res+= (j - v.back());
                    j = v.back();
                }
                else if (j <= v[0]){
                    res+= (v[0] - j);
                    j = v[0];
                }
                else{
                    auto it = lower_bound(all(v) , j);
                    ll ans1 = *it;
                    it--;
                    ll ans2 = *it;
                    if (abs(ans2 - j) < abs(ans1 - j))
                    {
                        res+=abs(ans2 - j);
                        j = ans2;
                    }
                    else{
                        res+=abs(ans1 - j);
                        j = ans2;
                    }
                }
                res+=(row - i);
                i = row;
            }
            else{
                ll ans1 = 0;
                ll ans2 = 0;
                ans1+= abs( j - edges[i].back());
                ans1+=abs(edges[i].back() - edges[i][0]);
                ans2+= abs( j - edges[i][0]);
                ans2+=abs(edges[i].back() - edges[i][0]);
                ll j1 = edges[i][0];
                ll j2 = edges[i].back();
                if (v.back() <= j1){
                    ans1+= (j1 - v.back());
                    j1 = v.back();
                }
                else if (j1 <= v[0]){
                    ans1+= (v[0] - j1);
                    j1 = v[0];
                }
                else{
                    auto it = lower_bound(all(v) , j1);
                    ll ans11 = *it;
                    it--;
                    ll ans22 = *it;
                    if (abs(ans22 - j1) < abs(ans11 - j1))
                    {
                        ans1+=abs(ans22 - j1);
                        j1 = ans22;
                    }
                    else{
                        ans1+=abs(ans11 - j1);
                        j1 = ans22;
                    }
                }
                if (v.back() <= j2){
                    ans2+= (j2 - v.back());
                    j2 = v.back();
                }
                else if (j2 <= v[0]){
                    ans2+= (v[0] - j2);
                    j2 = v[0];
                }
                else{
                    auto it = lower_bound(all(v) , j2);
                    ll ans11 = *it;
                    it--;
                    ll ans22 = *it;
                    if (abs(ans22 - j2) < abs(ans11 - j2))
                    {
                        ans2+=abs(ans22 - j2);
                        j2 = ans22;
                    }
                    else{
                        ans2+=abs(ans11 - j2);
                        j2 = ans22;
                    }
                }
                if (ans1 < ans2)
                {
                    res+=ans1;
                    j = j1;
                }
                else{
                    res+=ans2;
                    j = j2;
                }
                res+=(row - i);
                i = row;
            }
        }
    }

    if (edges[i].empty())
    {
        cout<<res<<endl;
    }
    else{

        ll ans1 = 0;
        ll ans2 = 0;
        ans1+= abs( j - edges[i].back());
        ans1+=abs(edges[i].back() - edges[i][0]);
        ans2+= abs( j - edges[i][0]);
        ans2+=abs(edges[i].back() - edges[i][0]);
        cout<<res+min(ans1 , ans2)<<endl;
    }
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ii pair<int, int>
#define il pair<int, ull>
#define pll pair<ll, ll>
#define iii pair<int , ii>
#define LOG(x) cout << x <<" ";
#define TRACE(x) cout << #x << " : " << x << endl
#define LOG2DArray(array, n, m) for ( int i = 1; i <= n ; i++) { for (int j = 1; j <= m; j++) { LOG(array[i][j]); } cout<<endl; } cout<<endl;
#define LOG1DArray(array, n)  for( int i = 1; i <= n ; i++){ cout<<i << " : ";LOG( array[i]); } cout<<endl;
#define myFor(i, l, r) for(ll i = (int) l;i< (int) r;i++)
#define _ << " : " <<
#define L(a) (int)((a).size())
#define sqr(x) ((x) * 1ll * (x))
#define vi vector<int>
#define vl vector<ll>
#define vul vector<ull>
#define mp make_pair
#define pub push_back
#define pob pop_back
#define vii vector <ii>
#define vll vector <pll>
#define vil vector <il>
#define viii vector <iii>
#define vs vector <string>
#define all(s) (s).begin(),(s).end()
#define allb(s,b) (s).begin()+b,(s).end()
#define allr(s) (s).rbegin(),(s).rend()
#define fore(i, l, r) for(int i = (int)l; i <= (int)r; i++)
#define forn(i, l, r) for(int i = (int)l; i >= (int)r; i--)
#define REP(i, n) for (int i = 1; i <= n; i++)
#define cinx int x; cin>>x
#define cinc char c; cin>>c
#define cinxl ll x; cin>>x
#define scan(TYPE,VALUE) TYPE VALUE;cin>>VALUE
#define sout cout<<endl
#define nbit(x) __builtin_popcount((ull)x)
#define ret(x) return cout<<x<<endl,0

const int maxn = 2e5+  5;
const int inf = (1e9);

ll n , m , k , q;
vl edges[maxn];
vl v;
int main(){
    fastio;
    cin>>n>>m>>k>>q;

    fore(i,1,k){
        ll l , r;
        cin>>l>>r;
        edges[l].pub(r);
    }
    fore(i,1,q){
        cinx;
        v.pub(x);
    }
    sort(all(v));
    fore(i,1,n){
        if (edges[i].empty())
            continue;
        sort(all(edges[i]));
    }
    ll i = 1;
    ll j = 1;
    ll res = 0;
    ll lasti = 1;
    if (!edges[1].empty()){
        j = edges[i].back();
        res+=(j-1);
    }
    fore(row,2,n){
        if (edges[row].empty() )
            continue;
        res+=(row - i);
        i = row;
        if (edges[i][0] >= j){
            if (v[0] >= edges[i][0]){
                res+= abs(v[0] - j);
                j = v[0];
            }
            else{
                auto it = lower_bound(all(v) , edges[i][0]);
                it--;
                res+= abs(*it - j);
                j = *it;
            }
            if (abs(edges[i].back() - j) < abs(edges[i][0] - j)){
                ans1+=abs(edges[i].back() - j);
                j = edges[i][0];
            }else{
                ans1+=abs(edges[i][0] - j);
                j = edges[i].back();
            }
            res+=abs(edges[i].back() - edges[i][0]);
        }
        else if (j >= edges[i].back()){
            if (v.back() <= edges[i].back()){
                res+= abs(j - v.back());
                j = v.back();
            }
            else{
                auto it = lower_bound(all(v) , edges[i][0]);
                res+= abs(*it - j);
                j = *it;
            }
            if (abs(edges[i].back() - j) < abs(edges[i][0] - j)){
                ans1+=abs(edges[i].back() - j);
                j = edges[i][0];
            }else{
                ans1+=abs(edges[i][0] - j);
                j = edges[i].back();
            }
            res+= abs(edges[i].back() - edges[i][0]);
        }
        else{
            ll j1 = j , j2 = j;
            ll ans1 = 0 ;
            ll ans2 = 0 ;
            if (edges[i].back() <= v[0]){
                ans1 += abs(j1 - v[0]);
                j1 = v[0];
            }
            else{
                auto it = lower_bound(all(v) , edges[i].back());
                it--;
                ans1+= abs(*it - j1);
                j1 = *it;
            }
            if (abs(edges[i].back() - j1) < abs(edges[i][0] - j1)){
                ans1+=abs(edges[i].back() - j1);
                j1 = edges[i][0];
            }else{
                ans1+=abs(edges[i][0] - j1);
                j1 = edges[i].back();
            }
            ans1+=abs(edges[i].back() - edges[i][0]);
            if (edges[i][0] >= v.back()){
                ans2 += abs(j2 - v.back());
                j2 = v.back();
            }
            else{
                auto it = lower_bound(all(v) , edges[i][0]);
                ans2+=abs(*it - j2);
                j2 = *it;
            }
            if (abs(edges[i].back() - j2) < abs(edges[i][0] - j2)){
                ans2+=abs(edges[i].back() - j2);
                j2 = edges[i][0];
            }else{
                ans2+=abs(edges[i][0] - j2);
                j2 = edges[i].back();
            }
            ans2+=abs(edges[i].back() - edges[i][0]);
            j2 = edges[i].back();
            if (ans1 < ans2){
                j = j1;
                res+=ans1;
            }
            else{
                j = j2;
                res+=ans2;
            }
        }
    }
    cout<<res<<endl;
}


#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ii pair<int, int>
#define il pair<int, ull>
#define pll pair<ll, ll>
#define iii pair<int , ii>
#define LOG(x) cout << x <<" ";
#define TRACE(x) cout << #x << " : " << x << endl
#define LOG2DArray(array, n, m) for ( int i = 1; i <= n ; i++) { for (int j = 1; j <= m; j++) { LOG(array[i][j]); } cout<<endl; } cout<<endl;
#define LOG1DArray(array, n)  for( int i = 1; i <= n ; i++){ cout<<i << " : ";LOG( array[i]); } cout<<endl;
#define myFor(i, l, r) for(ll i = (int) l;i< (int) r;i++)
#define _ << " : " <<
#define L(a) (int)((a).size())
#define sqr(x) ((x) * 1ll * (x))
#define vi vector<int>
#define vl vector<ll>
#define vul vector<ull>
#define mp make_pair
#define pub push_back
#define pob pop_back
#define vii vector <ii>
#define vll vector <pll>
#define vil vector <il>
#define viii vector <iii>
#define vs vector <string>
#define all(s) (s).begin(),(s).end()
#define allb(s,b) (s).begin()+b,(s).end()
#define allr(s) (s).rbegin(),(s).rend()
#define fore(i, l, r) for(int i = (int)l; i <= (int)r; i++)
#define forn(i, l, r) for(int i = (int)l; i >= (int)r; i--)
#define REP(i, n) for (int i = 1; i <= n; i++)
#define cinx int x; cin>>x
#define cinc char c; cin>>c
#define cinxl ll x; cin>>x
#define scan(TYPE,VALUE) TYPE VALUE;cin>>VALUE
#define sout cout<<endl
#define nbit(x) __builtin_popcount((ull)x)
#define ret(x) return cout<<x<<endl,0

const int maxn = 2e5+  5;
const int inf = (1e9);

ll n , m , k , q;
vl edges[maxn];
vl v;
int main(){
    fastio;
    cin>>n>>m>>k>>q;

    fore(i,1,k){
        ll l , r;
        cin>>l>>r;
        edges[l].pub(r);
    }
    fore(i,1,q){
        cinx;
        v.pub(x);
    }
    sort(all(v));
    fore(i,1,n){
        if (edges[i].empty())
            continue;
        sort(all(edges[i]));
    }
    ll i = 1;
    ll j = 1;
    ll res = 0;
    ll lasti = 1;
    if (!edges[1].empty()){
        j = edges[i].back();
        res+=(j-1);
    }
    fore(row,2,n){
        if (edges[row].empty() )
            continue;
        res+=(row - i);
        i = row;
        if (edges[i][0] >= j){
            if (v[0] >= edges[i][0]){
                res+= abs(v[0] - j);
                j = v[0];
            }
            else{
                auto it = lower_bound(all(v) , edges[i][0]);
                it--;
                res+= abs(*it - j);
                j = *it;
            }
            if (abs(edges[i].back() - j) < abs(edges[i][0] - j)){
                res+=abs(edges[i].back() - j);
                j = edges[i][0];
            }else{
                res+=abs(edges[i][0] - j);
                j = edges[i].back();
            }
            res+=abs(edges[i].back() - edges[i][0]);
        }
        else if (j >= edges[i].back()){
            if (v.back() <= edges[i].back()){
                res+= abs(j - v.back());
                j = v.back();
            }
            else{
                auto it = lower_bound(all(v) , edges[i][0]);
                res+= abs(*it - j);
                j = *it;
            }
            if (abs(edges[i].back() - j) < abs(edges[i][0] - j)){
                res+=abs(edges[i].back() - j);
                j = edges[i][0];
            }else{
                res+=abs(edges[i][0] - j);
                j = edges[i].back();
            }
            res+= abs(edges[i].back() - edges[i][0]);
        }
        else{
            ll j1 = j , j2 = j;
            ll ans1 = 0 ;
            ll ans2 = 0 ;
            if (edges[i].back() <= v[0]){
                ans1 += abs(j1 - v[0]);
                j1 = v[0];
            }
            else{
                auto it = lower_bound(all(v) , edges[i].back());
                it--;
                ans1+= abs(*it - j1);
                j1 = *it;
            }
            if (abs(edges[i].back() - j1) < abs(edges[i][0] - j1)){
                ans1+=abs(edges[i].back() - j1);
                j1 = edges[i][0];
            }else{
                ans1+=abs(edges[i][0] - j1);
                j1 = edges[i].back();
            }
            ans1+=abs(edges[i].back() - edges[i][0]);
            if (edges[i][0] >= v.back()){
                ans2 += abs(j2 - v.back());
                j2 = v.back();
            }
            else{
                auto it = lower_bound(all(v) , edges[i][0]);
                ans2+=abs(*it - j2);
                j2 = *it;
            }
            if (abs(edges[i].back() - j2) < abs(edges[i][0] - j2)){
                ans2+=abs(edges[i].back() - j2);
                j2 = edges[i][0];
            }else{
                ans2+=abs(edges[i][0] - j2);
                j2 = edges[i].back();
            }
            ans2+=abs(edges[i].back() - edges[i][0]);
            j2 = edges[i].back();
            if (ans1 < ans2){
                j = j1;
                res+=ans1;
            }
            else{
                j = j2;
                res+=ans2;
            }
        }
    }
    cout<<res<<endl;
}