#include<cstdio>
#include<iostream>
#define RI register int
#define CI const int&
using namespace std;
const int N=505;
const long long INF=1e18;
int n,a[N][N]; long long s1[N][N],s2[N][N],f[N][N],ans=INF;
int main()
{
	RI i,j,k; for (scanf("%d",&n),i=1;i<=n;++i)
	for (j=1;j<=n;++j) if (i!=j) scanf("%d",&a[i][j]);
	for (i=1;i<=n;++i) for (j=i+1;j<=n+1;++j)
	for (s1[i][j]=s1[i][j-1],k=i;k<j;++k) s1[i][j]+=a[k][j];
	for (i=1;i<=n;++i) for (j=n;j>i;--j)
	for (s2[i][j]=s2[i][j+1],k=1;k<=i;++k) s2[i][j]+=a[j][k];
	for (i=0;i<=n+1;++i) for (j=i;j<=n+1;++j) f[i][j]=INF;
	for (f[0][0]=i=0;i<=n;++i) for (j=i;j<=n;++j) if (f[i][j]!=INF)
	for (k=j+1;k<=n+1;++k) f[j][k]=min(f[j][k],f[i][j]+s1[j+1][k]+s2[j][k+1]-s2[i][k+1]);
	for (i=0;i<=n;++i) ans=min(ans,f[i][n+1]); return printf("%lld",ans),0;
}