program main;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
kol,ss,raz,f,t,j,tt,i,sum:integer;
s2: array [1..1000] of string;
t2,t1,max1,max2,s1,s3: array [1..100] of integer;
begin
assignfile(input,'E.in');
assignfile (output,'E.out');
reset (input);
rewrite (output);
t:=0;
For i:=1 to 3 do
readln (input, s2[i]);
for i:=1 to 3 do
begin
t:=t+1;
for j:= 0 to length(s2[i]) do
if (s2[i,j]<>' ') then
begin
s1[t]:=strtoint(inttostr(s1[t])+s2[i,j]);
end
else
t:=t+1;
end;
if s1[1]<s1[2] then kol:=s1[1] else kol:=s1[2];
max1[1]:=s1[3];
t1[1]:=4;
i:=1;
//for i:= 1 to kol do
For i:=1 to kol do
begin
for j:= 3 to s1[1]+2 do
if s1[j]<=max1[i] then
if not(tt=j) then
begin
tt:=j;
max2[i]:=s1[j];
end;
if not(tt=3) then max1[i+1]:=s1[tt-1] else max1[i+1]:=s1[tt+1];
end;
max2[1]:=s1[1]+3;
tt:=0;
For i:=1 to kol do
begin
for j:= s1[1]+3 to s1[1]+S1[2]+2  do
if s1[j]<=max2[i] then
if not(tt=j) then
begin
tt:=j;
max2[i]:=s1[j];
end;
if not(tt=3) then max2[i+1]:=s1[tt-1] else max2[i+1]:=s1[tt+1];
end;
j:=kol;
For i:=1 to trunc(kol/2)+1 do
begin
sum:=sum+(max1[i]*max2[j]);
j:=kol-1;
end;
writeln (inttostr(kol)+'  '+ inttostr(sum+2));
close (output);
  { TODO -oUser -cConsole Main : Insert code here }
end.
