#include <bits/stdc++.h>

const int MAXN = 510;
typedef long long LL;
int n;
LL A[MAXN][MAXN], B[MAXN][MAXN], dp[MAXN][MAXN];
void getmin(LL & x, LL y) { x > y ? x = y : 0; }

int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j < i; ++j) std::cin >> B[j][i];
		for (int j = i + 1; j <= n; ++j) std::cin >> A[i][j];
	}
	memset(dp, 0x3f, sizeof dp);
	dp[0][0] = 0;
	for (int i = 1; i <= n; ++i)
		for (int j = i + 1; j <= n; ++j)
			A[i][j] += A[i][j - 1];
	for (int i = n; i; --i)
		for (int j = i + 1; j <= n; ++j)
			A[i][j] += A[i + 1][j];
	for (int i = 1; i <= n; ++i)
		for (int j = i; j <= n; ++j)
			B[i][j] += B[i - 1][j];
	for (int i = 0; i <= n; ++i)
		for (int j = i; j <= n; ++j) {
			LL tot = 0;
			for (int k = j + 1; k <= n; ++k) {
				tot += B[i][k];
				getmin(dp[j][k], dp[i][j] + A[j + 1][k] + tot);
			}
		}
	LL ans = 0x3f3f3f3f3f3f3f3fLL;
	for (int i = 1; i <= n; ++i) getmin(ans, dp[i][n]);
	std::cout << ans << '\n';
	return 0;
}
