#include <bits/stdc++.h>
using namespace std;
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
typedef long long ll;
typedef long double ld;
ll A[505][505], pref[505], suf[505], ndp[505][505], dp[505][505];
int main() {
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < n; ++j) {
			if (i == j) continue;
			scanf("%lld", &A[i][j]);
		}
	const ll INF = 1LL << 60;
	for (int a = 0; a <= n; ++a)
		for (int b = 0; b <= n; ++b)
			dp[a][b] = INF;
	dp[0][0] = 0;
	for (int i = 1; i < n; ++i) {
		suf[i] = 0;
		for (int j = i - 1; j >= 0; --j) {
			suf[j] = suf[j + 1] + A[j][i];
		}
		pref[0] = A[i][0];
		for (int j = 1; j < i; ++j) {
			pref[j] = pref[j - 1] + A[i][j];
		}
		for (int a = 0; a <= n; ++a)
			for (int b = 0; b <= n; ++b)
				ndp[a][b] = INF;
		for (int a = 0; a < i; ++a)
			for (int b = 0; b <= a; ++b) {
				ndp[a][b] = min(ndp[a][b], dp[a][b] + (b == 0 ? 0 : pref[b - 1]) + suf[a]);
				ndp[i][a] = min(ndp[i][a], dp[a][b] + (a == 0 ? 0 : pref[a - 1]));
			}
		swap(dp, ndp);
	}
	ll ans = INF;
	for (int a = 0; a < n; ++a)
		for (int b = 0; b <= a; ++b)
			ans = min(ans, dp[a][b]);
	printf("%lld\n", ans);
}
