#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=505;
int f[505][505],sum[2][505][505];
int calc(int type,int x1,int y1,int x2,int y2){
	return sum[type][x2][y2]-sum[type][x1-1][y2]-sum[type][x2][y1-1]+sum[type][x1-1][y1-1];
}
int a[505][505];
void add(int &x,int y){
	x=min(x,y);
}
signed main(){
	int n;
	cin>>n;
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j){
			if(i==j) continue;
			cin>>a[i][j];
		}
	for(int i=1;i<=n;++i)
		for(int j=1;j<=n;++j){
			sum[0][i][j]=sum[0][i-1][j]+sum[0][i][j-1]-sum[0][i-1][j-1]+(i<j?a[i][j]:0);
			sum[1][i][j]=sum[1][i-1][j]+sum[1][i][j-1]-sum[1][i-1][j-1]+(i>j?a[i][j]:0);
		}
	memset(f,0x3f,sizeof(f));
	f[0][0]=0;
	for(int i=0;i<=n;++i)
		for(int j=0;j<=i;++j)
			for(int k=i+1;k<=n;++k)
				add(f[k][i],f[i][j]+calc(0,i+1,i+1,k,k)+calc(1,i+1,1,k,j));
	int ans=1e18;
	for(int i=0;i<n;++i)
		add(ans,f[n][i]);
	cout<<ans;
	return 0;
}