#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cmath>
#include<cstdlib>
#include<algorithm>
using namespace std;
#define maxn 100000000
#define N 100010
int l,s,t,m,a,ans;
int dp[N];
bool flag[N];
int main()
{
while(scanf("%d%d%d%d",&l,&s,&t,&m)!=EOF)
{
ans=maxn;
if(l==0) break;
memset(dp,-1,sizeof(dp));
memset(flag,0,sizeof(flag));
for(int i=0;i<m;i++)
{
scanf("%d",&a);
flag[a]=1;
}
dp[0]=0;
for(int i=s;i<=l+t-1;i++)
for(int j=i-t;j<=i-s;j++)//j--t
{
if(j>=0&&dp[j]!=-1)
{
if(dp[i]==-1) dp[i]=dp[j]+flag[i];
else dp[i]=min(dp[i],dp[j]+flag[i]);
}
}
for(int i=l;i<=l+t-1;i++)
if(dp[i]!=-1&&dp[i]<ans)
ans=dp[i];
printf("%d\n",ans);
}
return 0;
}