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

const int N=505;
LL n,a[N][N],b[N][N],dp[N][N];
inline LL geta(int s1,int s2,int t1,int t2) {
    if(s1>s2 || t1>t2) return 0;
    return a[s2][t2]-(s1?a[s1-1][t2]:0)-(t1?a[s2][t1-1]:0)+((s1&&t1)?a[s1-1][t1-1]:0);
}
inline LL getb(int s1,int s2,int t1,int t2) {
    if(s1>s2 || t1>t2) return 0;
    return b[s2][t2]-(s1?b[s1-1][t2]:0)-(t1?b[s2][t1-1]:0)+((s1&&t1)?b[s1-1][t1-1]:0);
}
inline LL trans(int x,int y,int z) {
    LL sum=getb(1,x,y+2,z+1);
    sum+=getb(x+1,y,z+1,z+1);
    sum+=geta(y+1,z,y+2,z);
    return sum;
}

int main() {
    cin>>n;
    for(int i=1;i<=n;i++) {
        for(int j=1;j<i;j++) cin>>b[j][i];
        for(int j=i+1;j<=n;j++) cin>>a[i][j];
    }
    for(int i=1;i<=n+1;i++)
        for(int j=1;j<=n+1;j++)
            a[i][j]=a[i-1][j]+a[i][j-1]-a[i-1][j-1]+a[i][j], b[i][j]=b[i-1][j]+b[i][j-1]-b[i-1][j-1]+b[i][j];
    
    memset(dp,0x3f,sizeof(dp));
    for(int i=1;i<n;i++) {
        dp[i][0]=trans(0,0,i);
        for(int p=0;p<i;p++)
            for(int j=i+1;j<n;j++)
                dp[j][i]=min(dp[j][i],trans(p,i,j)+dp[i][p]);
    }
    
    LL ans=trans(0,0,n);
    for(int i=1;i<n;i++)
        for(int p=0;p<i;p++)
            ans=min(ans,dp[i][p]+trans(p,i,n));
    cout<<ans<<'\n';
}
