Program mark;
Type
abc=record
f:longint;
h:longint;
p:longint;
end;
sc=array [1..1000] of abc;
Var
i,j,k:longint;
n,m:longint;
temp,temp1,temp2:longint;
s:sc;
o:boolean;
Begin
assign(input,'mark.in');
assign(output,'mark.out');
reset(input);
rewrite(output);
readln(n,m);
for i:=1 to n do readln(s[i].f);
readln(k);
for i:=1 to n do s[i].h:=i;
for i:=1 to (n-1) do begin
for j:=(i+1) to n do begin
if s[i].f<s[j].f then begin
temp:=s[i].f;
s[i].f:=s[j].f;
s[j].f:=temp;
temp:=s[i].h;
s[i].h:=s[j].h;
s[j].h:=temp;
end;
end;
end;
for i:=1 to n do
if s[i].h=k then temp1:=i;
s[1].p:=1;
for i:=2 to temp1 do begin
if s[i].f=s[i-1].f then s[i].p:=s[i-1].p
else s[i].p:=i;
end;
o:=false;
i:=1;
while o=false do begin
temp:=(i-1)*(n div m)+1;
temp2:=i*(n div m);
if (s[temp1].p>=temp)and(s[temp1].p<=temp2) then begin
o:=true;
k:=i;
end
else i:=i+1;
end;
writeln(k);
close(input);
close(output);
End.