program vrednost_dodele;
var
p:array[1..10000] of real;
o:array[1..1000] of longint;
i,j,t,l:integer;
m,n:longint;
e, r, power:real;
begin
read(n,m);
r:=0
for t:=1 to m do
    begin
    read(o[t]);
    end;
read(e);
for t:=1 to n do
    begin
    p[t]:=t;
    end;
i:=0;
for i:=0 to n-m do
begin
for j:=1 TO M DO
begin
p[i+o[j]]:=p[i+j];
end;
end;
for i:=0 to n-m do
begin
    power:=1;
    for l:=1 to i do
    begin
     power:=power*e;
     end;
    r:=x+power*r[i];
end;
write(r:0:0);
end.