#include<bits/stdc++.h>
#define read() Read<int>()
namespace pb_ds{   
    namespace io{
        const int MaxBuff=1<<15;
        const int Output=1<<23;
        char B[MaxBuff],*S=B,*T=B;
		#define getc() ((S==T)&&(T=(S=B)+fread(B,1,MaxBuff,stdin),S==T)?0:*S++)
        char Out[Output],*iter=Out;
        inline void flush(){
            fwrite(Out,1,iter-Out,stdout);
            iter=Out;
        }
    }
    template<class Type> inline Type Read(){
        using namespace io;
        register char ch;
        register Type ans=0; 
        register bool neg=0;
        while(ch=getc(),(ch<'0' || ch>'9') && ch!='-');
        ch=='-'?neg=1:ans=ch-'0';
        while(ch=getc(),'0'<= ch && ch<='9') ans=ans*10+ch-'0';
        return neg?-ans:ans;
    }
    template<class Type> inline void Print(register Type x,register char ch='\n'){
        using namespace io;
        if(!x) *iter++='0';
        else{
            if(x<0) *iter++='-',x=-x;
            static int s[100]; 
            register int t=0;
            while(x) s[++t]=x%10,x/=10;
            while(t) *iter++='0'+s[t--];
        }
        *iter++=ch;
    }
}
using namespace pb_ds;
using namespace std;
typedef long long ll;
const int N=505;
const ll inf=(ll)1e18;
int n;
int a[N][N],b[N][N];
ll ans=inf;
ll c[N][N],d[N][N],dp[N][N];
int main(){
	//freopen("negative.in","r",stdin);
	//freopen("negative.out","w",stdout);
	n=read();
	for (int i=1;i<=n;++i){
		for (int j=1;j<i;++j) a[j][i]=read();
		for (int j=i+1;j<=n;++j) b[i][j]=read();
	}
	for (int i=1;i<=n+1;++i){
		for (int j=i;j<=n+1;++j){
			c[i][j]=c[i-1][j];
			for (int k=j;k<=n;++k) c[i][j]+=a[i][k];
		}
	}
	for (int i=n+1;i;--i){
		for (int j=i;j<=n+1;++j){
			d[i][j]=d[i+1][j];
			for (int k=i;k<=j;++k) d[i][j]+=b[i][k];
		}
	}
	memset(dp,0x3f,sizeof(dp));
	dp[0][0]=0;
	for (int i=1;i<=n+1;++i)
		for (int j=0;j<i;++j)
			for (int k=0;k<=j;++k)
				dp[i][j]=min(dp[i][j],dp[j][k]+c[j][i+1]-c[k][i+1]+d[j+1][i]);
	for (int i=0;i<=n;++i)
		ans=min(ans,dp[n+1][i]);
	printf("%lld\n",ans);
	return 0;
}