#include <bits/stdc++.h>
using namespace std;
const int N=100+5;
int n,m,k;
int a[N][N],f[N];
int main(){
freopen ("zjoi13_ant.in","r",stdin);
freopen ("zjoi13_ant.out","w",stdout);
scanf("%d%d%d",&n,&m,&k);
for (int i=1;i<=n;i++){
for (int j=1;j<=m;j++)scanf("%d",&a[i][j]);
}
for (int i=1;i<=m;i++){
for (int j=1;j<=n;j++)a[j][i]+=a[j-1][i];
}int ans=0;
for (int i=1;i<=n;i++){
for (int j=i;j<=n;j++){
for (int k=1;k<=m;k++){
f[k]=max(a[j][k]-a[i-1][k],f[k-1]+a[j][k]-a[i-1][k]);
ans=max(ans,f[k]);
}
}
}printf("%d\n",ans);
}