program teren;
var a: array[0..300,0..300] of integer;
n,m,i,j,x,ip,jp,s,amax,ar: integer;
f: text;
begin
assign(f,'teren.in');
reset(f);
readln(f,n,m,x);
for i:=1 to n do
begin
for j:=1 to m do
begin
read(f,ip);
a[i,j]:=a[i-1,j]+a[i,j-1]-a[i-1,j-1]+ip;
end;
readln(f);
end;
close(f);
assign(f,'teren.out');
rewrite(f);
if x>a[n,m] then
begin
write(f,n*m);
close(f);
exit;
end;
i:=1;j:=1;ip:=1;jp:=1;s:=a[i,j];
while (ip<n) or (jp<m) do
begin
while (x>=s) and ((ip<n) or (jp<m)) do
begin
if ip<n then inc(ip);
s:=a[ip,jp]-a[ip,j-1]-a[i-1,jp]+a[i-1,j-1];
ar:=(ip-i+1)*(jp-j+1);
if jp<m then inc(jp);
if (ar>amax) and (s<=x) then amax:=ar;
s:=a[ip,jp]-a[ip,j-1]-a[i-1,jp]+a[i-1,j-1];
ar:=(ip-i+1)*(jp-j+1);
if (ar>amax) and (s<=x) then amax:=ar;
end;
if (x<s) and ((i<ip) or (j<jp)) then
begin
if i<ip then inc(i);
s:=a[ip,jp]-a[ip,j-1]-a[i-1,jp]+a[i-1,j-1];
ar:=(ip-i+1)*(jp-j+1);
if (ar>amax) and (s<=x) then begin amax:=ar; end;
if j<jp then inc(j);
s:=a[ip,jp]-a[ip,j-1]-a[i-1,jp]+a[i-1,j-1];
ar:=(ip-i+1)*(jp-j+1);
if (ar>amax) and (s<=x) then begin amax:=ar; end;
end;
end;
write(f,amax);
close(f);
end.