#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
using namespace std;
#define MOD 1000000007
#define INF (1<<29)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long Int;
typedef pair<Int, Int> P;

Int a[540][540];
Int n;
Int dp[540][540];
Int minuss[540][540];
Int pluss[540][540];
Int calc(Int i, Int j, Int k){
    Int res = minuss[j][k] + pluss[0][k] + pluss[i][j] - pluss[0][j] - pluss[i][k];
//    cout << i << " " << j << " " << k << ":" << res << endl;
    return res;
}

int main(){
    cin >> n;
    for(int i = 0;i < n;i++){
        for(int j = 0;j < n;j++){
            if(i == j)continue;
            cin >> a[i][j];
        }
    }
    for(Int k = 2;k <= n;k++){
        for(Int i = 0;i + k <= n;i++){
            Int j = i + k;
            minuss[i][j] = minuss[i][j-1] + minuss[i+1][j] - minuss[i+1][j-1] + a[i][j-1];
            pluss[i][j] = pluss[i][j-1] + pluss[i+1][j] - pluss[i+1][j-1] + a[j-1][i];
//            cout << i << " " << j << " " << minuss[i][j] << " " << pluss[i][j] << endl;
        }
    }
    for(Int i = 1;i <= n;i++){
        dp[0][i] = minuss[0][i];
        
        //      cout << "dp["<< 0 <<"][" << i <<"]: " << dp[0][i] << endl;
    }

    for(Int i = 1;i < n;i++){
        for(Int j = i+1;j <= n;j++){
            dp[i][j] = LINF;
            for(Int k = 0;k < i;k++){
                dp[i][j] = min(dp[i][j], dp[k][i] + calc(k, i, j));
            }
//            cout << "dp["<< i <<"][" << j <<"]: " << dp[i][j] << endl;
        }
    }
    Int res = LINF;
    for(Int i = 0;i < n;i++){
        res = min(res, dp[i][n]);
    }
    cout << res << endl;
    
    return 0;
}