program mark;
var
n,m,x,i,j,k,t:integer;
mc1,mc2:real;
mc:array[1..1000]of integer;
a,b,c:array[1..1000]of integer;
begin
assign(input,'mark.in');
reset(input);
assign(output,'mark.out');
rewrite(output);
readln(n,m);
for i:=1 to n do
begin
readln(a[i]);
b[i]:=i;
end;
read(x);
for i:=1 to n-1 do
for j:=i+1 to n do
if a[j]>a[i] then
begin
t:=a[i];
a[i]:=a[j];
a[j]:=t;
t:=b[i];
b[i]:=b[j];
b[j]:=t;
end;
for i:=1 to n-1 do
for j:=1 to n do
if a[i]=a[j] then mc[j]:=mc[i];
for i:=1 to n do
mc[b[i]]:=i;
{for i:=1 to n do
writeln(a[i],' ',b[i],' ',mc[i]);}
for i:=1 to n do
for j:=1 to m do
begin
mc1:=(j-1)*(n/m)+1;
mc2:=j*(n/m);
if (mc[i]>=((j-1)*(n/m)+1))and(mc[i]<=(j*(n/m))) then c[i]:=j;
end;
write(c[x]);
close(input);
close(output);
end.