#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const long long inf=0x3f3f3f3f3f3f3f3f;
int n;
long long s1[510][510],s2[510][510],dp[510][510],ans=inf;
long long get1(int x,int y){return s1[y][y]-s1[x][y]-s1[y][x]+s1[x][x];}
long long get2(int w,int x,int y){return s2[y][w]-s2[x][w];}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j)
			if(i!=j)scanf("%d",i<j?&s1[i][j]:&s2[i][j]);
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j)s1[i][j]+=s1[i][j-1],s2[i][j]+=s2[i][j-1];
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j)s1[i][j]+=s1[i-1][j],s2[i][j]+=s2[i-1][j];
	memset(dp,0x3f,sizeof(dp));
	dp[0][0]=0;
	for(int i=0;i<n;++i)
		for(int j=0;j<i+(!i);++j)
			for(int k=i+1;k<=n;++k)
				dp[k][i]=min(dp[k][i],dp[i][j]+get1(i,k)+get2(j,i,k));
//	for(int i=1;i<=n;++i)
//	{
//		for(int j=0;j<i;++j)printf("%lld ",dp[i][j]);
//		printf("\n");
//	}
	for(int i=0;i<n;++i)ans=min(ans,dp[n][i]);
	printf("%lld",ans);
	return 0;
}
