type mas=array[-10000..10000000] of integer; var n,a,b,c:integer; m:mas; max,j,t,l,i:integer; begin assign(input,'task4.in'); reset(input); assign(output,'task4.out'); rewrite(output); readln(n); for a:=1 to n do for b:=1 to n do for c:=1 to n do begin t:=a+b+c; m[t]:=m[t]+1; t:=a+b-c; m[t]:=m[t]+1; t:=a+b*c; m[t]:=m[t]+1; t:=a-b+c; m[t]:=m[t]+1; t:=a-b-c; m[t]:=m[t]+1; t:=a-b*c; m[t]:=m[t]+1; t:=a*b+c; m[t]:=m[t]+1; t:=a*b-c; m[t]:=m[t]+1; t:=a*b*c; m[t]:=m[t]+1; end; if n=1 then max:=1 else begin max:=0; for i:=1-n*n to n*n*n-1 do if m[i]>=max then max:=i; end; writeln(max); close(input); close(output); end.