#include <iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
#include<map>
#include<vector>

#define inf 1000000

using namespace std;

int a[222222],b[222222];

int Left=1,n,k,m;

bool check(int j) {
	for (int x=j; x < k+j; x++)
		if (a[x] + b[x-j+1] > 1) return 0;
	return 1;
}

void relax(int j) {
	for (int x=j; x < k+j; x++)
		a[x]+=b[x-j+1];
}

void slow() {
	int ans=0;
	for (int i=1; i <= n; i++) {
		for (int j=1; j <= inf; j++)
			if (check(j) == 1) {
				relax(j);
				ans=j;
				break;
			}
	}
	ans+=k-1;
	printf("%d\n",ans);
}

int main() {
	freopen("B.in","r",stdin);
	freopen("B.out","w",stdout);
	int l;
	scanf("%d%d%d",&n,&m,&k);
	scanf("%d",&l);
	memset(a,0,sizeof(a));
	memset(b,0,sizeof(b));
	for (int i=1; i <= l; i++) {
		int x;
		scanf("%d",&x);
		b[x]=1;
	}
	if (n <= 100000) {
		slow();
		return 0;
	}

	for (int i=1; i <= k; i++)
		a[i]=b[i];
	int Right;
	if (n % m == 0) Right=0; else Right=k;
	for (int i=2; i <= min(n,m); i++) {
		for (int j=1; j <= inf; j++)
			if (check(j) == 1) {
				relax(j);
				Left=j;
				break;
			}
	 	if (i == n % m) Right=Left+k-1;
	}
	if (n <= m) {
		printf("%d\n",Left+k-1);
		return 0;
	}

	long long p1=Left+k-1,p2;

	for (int j=1; j <= inf; j++)
		if (check(j) == 1) {
			relax(j);
			p2=j;
			break;
		}
	long long per=max(p1-p2+1,0LL),kol=n/m;
	if (kol == 1 && Right > 0) per*=1; else
		per*=(kol-1);

//	cout << per << " " << p1 << " " << p2 << " " << Right << " " << kol <<"\n";

	long long ans;
	ans=(kol*p1-per)+Right;
	printf("%I64d\n",ans);

	return 0;
}
