#include<bits/stdc++.h>
using namespace std;

typedef long long LL;

const int N=500;
const LL INF=(1LL<<50)-1;

int n,a[N+9][N+9];

void into(){
  scanf("%d",&n);
  for (int i=1;i<=n;++i)
	for (int j=1;j<=n;++j)
	  if (i^j) scanf("%d",&a[i][j]);
}

LL sum[N+9][N+9][2];

void Get_sum(){
  for (int i=1;i<=n;++i){
	for (int j=1;j<=n;++j){
	  if (i^j) i<j?sum[i][j][0]=a[i][j]:sum[i][j][1]=a[i][j];
	  for (int k=0;k<2;++k) sum[i][j][k]+=sum[i][j-1][k];
	}
    for (int j=1;j<=n;++j)
	  for (int k=0;k<2;++k) sum[i][j][k]+=sum[i-1][j][k];
  }
}

LL Get_sum(int id,int x0,int y0,int x1,int y1){return sum[x1][y1][id]-sum[x1][y0-1][id]-sum[x0-1][y1][id]+sum[x0-1][y0-1][id];}

LL dp[N+9][N+9],ans;

void Get_dp(){
  for (int i=0;i<=n;++i)
	for (int j=0;j<=n;++j) dp[i][j]=INF;
  dp[0][0]=0;
  for (int i=0;i<=n;++i)
	for (int j=0;j<max(i,1);++j)
	  for (int k=i+1;k<=n;++k){
		LL t=dp[i][j]+Get_sum(1,k+1,j+1,n,i)+Get_sum(0,i+1,i+1,k,k);
		dp[k][i]=min(dp[k][i],t);
	  }
  ans=INF;
  for (int i=1;i<=n;++i) ans=min(ans,dp[n][i]);
}

void work(){
  Get_sum();
  Get_dp();
}

void outo(){
  printf("%lld\n",ans);
}

int main(){
  into();
  work();
  outo();
  return 0;
}