#include<bits/stdc++.h>
#define ll long long
#define N 510
#define INF 1000000000000000000ll
using namespace std;
ll ans=INF,dp[N][N],a[N][N],n,g[N][N],f[N][N];
ll co1(int l,int r,int x){return f[x][r]-f[x][l-1];}
ll co2(int x,int l,int r){return g[x][r]-g[x][l-1];}
int main(){
	cin>>n;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)if (i!=j)cin>>a[i][j];
	for (int i=0;i<=n;i++)
		for (int j=i;j<=n+1;j++)dp[i][j]=INF;
	for (int i=1;i<=n;i++)
		for (int j=1;j<=n;j++)
			g[i][j]=g[i][j-1]+a[i][j],f[i][j]=f[i][j-1]+a[j][i];
	dp[0][0]=0;
	for (int i=1;i<=n;i++)
		for (int j=1;j<i;j++)dp[0][0]+=a[i][j];
	for (int i=0;i<n;i++){
		for (int j=i;j<=n;j++){
			ll su=0;
			for (int k=j+1;k<=n+1;k++){
				su=su+co1(j,k-2,k-1)-co2(k-1,i,k-2);
				dp[j][k]=min(dp[j][k],dp[i][j]+su);
				if (k==n+1)ans=min(ans,dp[j][k]);
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}
