#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << (x) << endl
using namespace std;

const int N = 505;
const long long inf = 1000000000000000ll;

int n;
long long a[N][N], pre1[N][N], pre2[N][N], f[N][N], ans = 0ll, mx = -inf;

long long query1 (int l1, int r1, int l2, int r2) {
	return pre1[r1][r2] - pre1[l1 - 1][r2] - pre1[r1][l2 - 1] + pre1[l1 - 1][l2 - 1];
}

long long query2 (int l1, int r1, int l2, int r2) {
	return pre2[r1][r2] - pre2[l1 - 1][r2] - pre2[r1][l2 - 1] + pre2[l1 - 1][l2 - 1];
}

int main () {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		a[i][i] = 0ll;
		for (int j = 1; j < n; j++) {
			int u = i, v = j;
			if (v >= i) v++;
			scanf("%lld", &a[u][v]), ans += a[u][v];
		}
	}

	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= n; j++) pre1[i][j] = pre2[i][j] = 0ll;
	}

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			long long val1 = i > j ? max(a[i][j], 0ll) : 0ll;
			long long val2 = i < j ? max(a[i][j], 0ll) : 0ll;
			pre1[i][j] = pre1[i - 1][j] + pre1[i][j - 1] - pre1[i - 1][j - 1] + val1;
			pre2[i][j] = pre2[i - 1][j] + pre2[i][j - 1] - pre2[i - 1][j - 1] + val2;
		}
	}

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= i; j++) {
			f[i][j] = -inf;
			if (j <= 1) f[i][j] = max(f[i][j], query1(1, i, 1, i));
			else {
				for (int k = 1; k < j; k++) f[i][j] = max(f[i][j], f[j - 1][k] + query1(j, i, k, i) + query2(1, j - 1, j, i));
			}
			if (i == n) mx = max(mx, f[n][j]);
		}
	}

	ans -= mx;
	printf("%lld\n", ans);
	return 0;
}