{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  n,m,k,i,j,l,l_a,l_l_k,res,next,temp_next:longint;
  a,com:array of boolean;
  l_k,c_m:array of longint;

function Nalogitsa_Blok(to_i:integer):Boolean;
var g,i:integer;
begin
 g:=0;
 result:=true;
 for i:=to_i to res do
  begin
   inc(g);
   if a[i] and com[g] then result:=false;
   if c_m[i]+1>m then result:=false;
  end;
end;

function Find_Next(from,konec:integer):integer;
var i:integer;
begin
 Result:=-1;
 for i:=from to konec-1 do
  if Nalogitsa_Blok(i) then
   begin
    Result:=i;
    break;
  end;  
end;

procedure Nalogit_Com(from:integer);
var g:integer;
begin
 g:=0;
 res:=res-(res-from)+k;
 setlength(a,res+1);
 setlength(c_m,res+1);
 for i:=from to res-1 do
  begin
   inc(g);
   a[i]:=a[i] or com[g];
   inc(c_m[i]);
  end;
end;

begin
  assign(input,'B.in'); reset(input);
  assign(output,'B.out'); rewrite(output);
  readln(n,m,k);
  readln(l);
  setlength(l_k,l+1);
  for i:=1 to l do
    read(l_k[i]);
  setlength(com,k+1);
  for i:=1 to l do
    com[l_k[i]]:=true;
  setlength(a,k+1);
  a:=com;
  setlength(c_m,k+1);
  res:=k+1;
  next:=2;
  for i:=1 to k do
   c_m[i]:=1;
  for i:=1 to n-1 do
  begin
   temp_next:=find_next(next,res);
   if temp_next<>-1 then
    begin
     next:=temp_next;
     nalogit_com(next);
    end
   else
    begin
     next:=res;
     nalogit_com(next);
    end;
  end;
  writeln(res-1);
  close(input);
  close(output);
end.
