var
n,i,max:longint;
a,s:array[0..100000]of longint;
function min(x,y:longint):longint;
begin
if x<y then exit(x);
exit(y);
end;
procedure go(k,last,money,who:longint);
var
i:longint;
begin
if k>n then
begin
if money>max then max:=money;
exit;
end;
for i:=1 to min(last*2,n-k+1) do
begin
if who=1 then go(k+i,i,money+s[k+i-1]-s[k-1],who xor 1)
else go(k+i,i,money,who xor 1);
end;
end;
begin
assign(input,'xoinc.in'); reset(input);
assign(output,'xoinc.out'); rewrite(output);
readln(n);
for i:=1 to n do
begin
read(a[i]);
s[i]:=s[i-1]+a[i];
end;
max:=-maxlongint;
go(1,1,0,1);
writeln(max);
close(input);
close(output);
end.