#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
ll w[505][505];
ll dp[505][505];
ll sum[505][505];
ll tot[505][505];
inline ll calc(int a,int b,int c,int d){
	return sum[b][d]-(a==0?0:sum[a-1][d])-(c==0?0:sum[b][c-1])-(a==0||b==0?0:sum[a-1][c-1]);
}
int main(){
//	freopen("park.in","r",stdin);
//	freopen("park.out","w",stdout); 
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++){
			if(i==j) continue;
			scanf("%d",&w[i][j]);
		}
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			sum[i][j]=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1]+w[i][j];
	for(int i=1;i<=n;i++)
		for(int j=1;j<=n;j++)
			tot[i][j]=tot[i-1][j]+tot[i][j-1]-tot[i-1][j-1]+(i<j?w[i][j]:0);
	for(int i=1;i<=n;i++){
		dp[i][1]=tot[i][i];
		for(int j=2;j<=i;j++){
			dp[i][j]=1e18;
			for(int k=1;k<j;k++)
				dp[i][j]=min(dp[i][j],dp[j-1][k]+tot[i][i]-tot[i][j-1]-tot[j-1][i]+tot[j-1][j-1]+calc(j,i,0,k-1));
		} 
	}		
	ll ans=1e18;
	for(int i=1;i<=n;i++) ans=min(ans,dp[n][i]);
	printf("%lld\n",ans);
	return 0;
} 