#include<cstdio>
#include<algorithm>
using namespace std;
int n;
long long w[510][510], D[510][510], w2[510][510];
long long S[510][510], S2[510][510];
int main() {
	int i, j, k;
	scanf("%d", &n);
	for (i = 1; i <= n; i++) {
		for (j = 1; j <= n; j++) {
			if (i == j)continue;
			scanf("%lld", &w[i][j]);
			if (i < j)w2[i][j] = w[i][j];
		}
	}
	for (i = 1; i <= n; i++) {
		for (j = 1; j <= n; j++) {
			S[i][j] = S[i - 1][j] + S[i][j - 1] - S[i - 1][j - 1] + w[i][j];
			S2[i][j] = S2[i - 1][j] + S2[i][j - 1] - S2[i - 1][j - 1] + w2[i][j];
		}
	}
	for (i = 1; i <= n; i++) {
		D[i][0] = S2[i][i];
		for (j = 1; j < i; j++) {
			D[i][j] = 1e18;
			long long u = S2[i][i] - S2[j][i] - S2[i][j] + S2[j][j];
			for (k = 0; k < j; k++) {
				D[i][j] = min(D[i][j], D[j][k] + u + S[i][k] - S[j][k]);
			}
		}
	}
	long long res = 1e18;
	for (i = 0; i < n; i++)res = min(res, D[n][i]);
	printf("%lld\n", res);
}