#include <iostream>
#include <cstdio>
using namespace std;
#define mx 100001
#define maxn 1000
int t[20][mx+mx]={0};
int id[mx+mx]={0};
int n,m,k,kol,l,tmp;
bool a[20]={0};
bool b[mx+mx]={0};
bool temp;
int kmp[mx+mx];
long long ans,qwe;

int main(){
	freopen("B.in","r",stdin);
	freopen("B.out","w",stdout);
	scanf("%d%d%d%d",&n,&m,&k,&l);
	for (int i=1;i<=k;++i)t[1][i]=1;
	for (int i=0;i<l;++i){
		scanf("%d",&tmp);
		a[tmp]=1;
		t[1][tmp]=2;b[tmp]=1;
	}
	kol=k;
	id[1]=kol;
	int le,ko;
	for (int i=2;i<=min(n,maxn);++i){
		for (le=1;le<=kol+1;++le){
			temp=1;
			for (int q=1;q<=k;++q)if (a[q]&&b[q+le-1]){temp=0;break;}
			if (temp){
				for (ko=1;ko<=m;++ko){
					temp=1;
					for (int q=1;q<=k;++q)if (t[ko][le+q-1]>0){temp=0;break;}
					if (temp)break;
				}
			}
			if (temp)break;
		}
		for (int q=1;q<=k;++q)
			if (a[q])t[ko][q+le-1]=2,b[q+le-1]=1;else t[ko][q+le-1]=max(1,t[ko][q+le-1]);
		kol=max(kol,k+le-1);
		id[i]=kol;
	}
	if (n<maxn){
		printf("%d\n",kol);
		return 0;
	}
	kmp[1]=0;
	ko=0;
	while (kol>0&&t[1][kol]==0)--kol;
	for (int i=2;i<=kol;++i){
		while (ko>0&&t[1][ko+1]!=t[1][i])ko=kmp[ko];
		if (t[1][ko+1]==t[1][i])++ko;
		kmp[i]=ko;
	}
	ko=kol-kmp[kol];
	ko=max(ko,k);
	for (le=1;le<=min(n,mx);++le)if (id[le]-k==ko)break;le--;
	qwe=id[le]-id[le+1]+k;
	tmp=(n-1)%le+1;//2
	ko=(n-1)/le;//1
	ans=id[le];//6
	qwe*=ko;//0
	ans*=ko;//6
	ans+=id[tmp];
	printf("%I64d\n",ans-qwe);
	return 0;
}
