program dianchi;
var
a:array[1..1000]of longint;
max,i,j,k,n,sum:longint;
s:real;
begin
assign(input,'dianchi.in');reset(input);
assign(output,'dianchi.out');rewrite(output);
readln(n);
while not eoln do
begin
sum:=0;
max:=0;
for i:=1 to n do
begin
read(a[i]);
sum:=sum+a[i];
end;
for i:=1 to n do
begin
if a[i]>max then
max:=a[i];
end;
if sum> (2*max) then
s:=sum/2
else
s:=sum-max;
writeln(s:0:1);
readln(n);
end;
close(input);close(output);
end.