#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;

ll a[505][505];
int n, m;
int main(){
scanf("%d%d", &n, &m);
for (int i=1; i<=n; i++){
for (int j=1; j<=m; j++){
scanf("%lld", &a[i][j]);
}
}
ll maxx=-9999;
for (int i=1; i<=n; i++){
ll t[505];
memset(t, 0, sizeof(t));
for (int j=i; j<=n; j++){
for (int k=1; k<=m; k++){
t[k]+=a[j][k];
}
ll tmax=-9999;
for (int k=1; k<=m; k++){
if (tmax<0) tmax=0;
tmax+=t[k];
maxx=max(maxx, tmax);
}
}
}
printf("%lld", maxx);
return 0;
}
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;

ll a[255][255];
ll n, m, k;
int main(){
scanf("%lld%lld%lld", &n, &m, &k);
for (ll i=1; i<=n; i++){
for (ll j=1; j<=m; j++){
scanf("%lld", &a[i][j]);
}
}
ll res=-1;
for (ll i=1; i<=n; i++){
ll t[505];
memset(t, 0, sizeof(t));
for (ll j=i; j<=n; j++){
for (ll v=1; v<=m; v++){
t[v]+=a[j][v];
}
ll sum=0;
int pos=1;
for (ll v=1; v<=m; v++){
sum+=t[v];
while (sum>k && pos<v){
sum-=t[pos];
pos++;
}
res=max(res, (j-i+1)*(v-pos+1));
}
}
}
printf("%d", res);
return 0;
}