#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#ifdef _debug
#define dout(i) cout << #i << ' ' << i << ' '
#else 
#define dout(i) //
#endif
using ll = long long;
using ull = unsigned long long;
using ul = unsigned;
using db = double;
int n;
const int maxn = 600;
ll dp[maxn][maxn];
ll w[maxn][maxn];
ll p[maxn][maxn];
ll to[maxn][maxn];
const ll inf = 1ll << 59;
ll get(int a, int b, int c, int d){
	if(a > b || c > d)return 0;
	return p[b][d] - (c == 0 ? 0 : p[b][c-1]) - (a == 0 ? 0 : p[a-1][d]) + (a == 0 || c == 0 ? 0 : p[a-1][c-1]);
}
ll get_to(int l, int r){
	return to[r][r] - to[l-1][r] - to[r][l-1] + to[l-1][l-1];
} 
int main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(int i = 1;i <= n;++i)for(int j = 1;j <= n;++j)if(i != j)cin >> w[i][j];
	for(int i = 1;i <= n;++i)for(int j = 1;j <= n;++j)p[i][j] = p[i-1][j] + p[i][j-1] - p[i-1][j-1] + w[i][j];
	for(int i = 1;i <= n;++i)for(int j = 1;j <= n;++j)to[i][j] = to[i-1][j] + to[i][j-1] - to[i-1][j-1] + (i < j ? w[i][j] : 0);
	for(int i = 1;i <= n;++i)fill(dp[i], dp[i] + maxn, inf);
	for(int i = 1;i <= n;++i){
		dp[i][1] = get_to(1, i);
		for(int j = 2;j <= i;++j){
			for(int k = 1;k < j;++k){
				dp[i][j] = min(dp[i][j], dp[j-1][k] + get_to(j, i) + get(j, i, 0, k-1));
			}
			// cout << i << ' ' << j << ' ';dout(dp[i][j])<<'\n';
		}
	}
	ll res = inf;
	for(int i = 1;i <= n;++i)res = min(res, dp[n][i]);
	cout << res << '\n';
}