#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define per(i,a,n) for(int i=n-1;i>=a;i--)
typedef long long ll;
typedef double db;
typedef pair<int,int> PII;
typedef vector<int> VI;
const ll mod=1000000007;
const int maxn=155;
const int inf=0x3f3f3f3f;
ll gcd(ll a,ll b){ return b?gcd(b,a%b):a;}
#define ms(a) memset(a,0,sizeof(a))
#define mss(a) memset(a,-1,sizeof(a))
#define msi(a) memset(a,inf,sizeof(a))
ll a[maxn][maxn];
ll b[maxn];
ll dp[maxn];
ll maxx=-inf,n;
int main()
{
cin>>n;
rep(i,1,n+1)
rep(j,1,n+1)
{
cin>>a[i][j];
}
rep(i,1,n+1)
{
rep(j,i,n+1)
{
rep(z,1,n+1)
{
b[z]+=a[j][z];
}
}
rep(z,1,n+1)
{
b[z]=max(b[z],b[z-1]+b[z]);
maxx=max(b[z],maxx);
}
memset(b,0,sizeof(b));
}
cout<<maxx<<"\n";
return 0;
}