program ex;
type
ss=array[1..5000]of integer;
var
f:ss;
t,n,m:longint;
s1,s2:string;
procedure init;
var
i,j:integer;
begin
assign(input,'wordsa.in');
assign(output,'wordsa.out');
reset(input);
rewrite(output);
readln(n);
for i:=1 to n do readln(f[i]);
for i:=1 to n-1 do
for j:=i+1 to n do
if f[i]>f[j] then
begin
f[i]:=f[i]+f[j];
f[j]:=f[i]-f[j];
f[i]:=f[i]-f[j];
end;
readln(s1);
readln(s2);
close(input);
{i believe springbrother}
randomize;
m:=random(n);
for i:=1 to m do t:=t+f[i];
writeln(t);
close(output);
end;
begin
init;
end.