#include <bits/stdc++.h>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;

const ll INF = 1e18;
const int MAXN = 505;

int n;
ll w[MAXN][MAXN],f[MAXN][MAXN],sum1[MAXN][MAXN],sum2[MAXN][MAXN];

ll getVal1(int a,int b,int c,int d){
	return sum1[b][d] - (c == 0 ? 0 : sum1[b][c - 1]) - (a == 0 ? 0 : sum1[a - 1][d]) + (a == 0 || c == 0 ? 0 : sum1[a - 1][c - 1]);
}

ll getVal2(int a,int b,int c,int d){
	return sum2[b][d] - (c == 0 ? 0 : sum2[b][c - 1]) - (a == 0 ? 0 : sum2[a - 1][d]) + (a == 0 || c == 0 ? 0 : sum2[a - 1][c - 1]);
}

int main(){
    //freopen(".in","r",stdin);
    //freopen(".out","w",stdout);
	scanf("%d",&n);
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= n;j++){
			if(i != j)
			    scanf("%d",&w[i][j]);
		}
	}
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= n;j++)
		    sum1[i][j] = sum1[i - 1][j] + sum1[i][j - 1] - sum1[i - 1][j - 1] + w[i][j];
	}
	for(int i = 1;i <= n;i++){
		for(int j = 1;j <= n;j++)
		    sum2[i][j] = sum2[i - 1][j] + sum2[i][j - 1] - sum2[i - 1][j - 1] + (i < j ? w[i][j] : 0);
	}
	for(int i = 1;i <= n;i++){
		f[i][1] = getVal2(0,i,0,i);
		for(int j = 2;j <= i;j++){
			f[i][j] = INF;
			for(int k = 1;k < j;k++)
				f[i][j] = min(f[i][j],f[j - 1][k] + getVal2(j,i,j,i) + getVal1(j,i,0,k - 1));
		}
	}
	ll ans = INF;
	for(int i = 1;i <= n;i++)
	    ans = min(ans,f[n][i]);
	printf("%lld\n",ans);
	return 0;
}
