program massiv; var i,n,max,sr,min:longint; a:array[1..1000]of longint; begin read(n); for i:=1 to n do read(a[i]); max:=-999999; min:=999999; for i:=1 to n do begin if a[i]>max then max:=a[i]; if a[i]<min then max:=a[i]; end; sr:=(max+min)div 2; writeln(sr); end.
program massiv;
var i,n,max,sr,min:longint;
a:array[1..1000]of longint;
begin
read(n);
for i:=1 to n do
read(a[i]);
max:=-999999;
min:=999999;
for i:=1 to n do
begin
if a[i]>max then max:=a[i];
if a[i]<min then max:=a[i];
end;
sr:=(max+min)div 2;
writeln(sr);
end.