#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 510;
int n;
ll a[2][N][N], f[N][N];
ll sum[2][N][N];

ll getsum(int sig, int a,int b, int x, int y) {
	//(a,x) (b,y)
	swap(x, b);
	if (a <= x && b <= y)
		return sum[sig][x][y] - sum[sig][a - 1][y] - sum[sig][x][b - 1] + sum[sig][a - 1][b - 1];
	else return 0;
}

ll ss;
int main() {
	cin>>n;
	for(int i = 1; i <= n; i++) {
		for(int j = 1; j <= n; j++) {
			if (i != j) {
				scanf("%lld\n", &a[i<j][i][j]), ss += a[i<j][i][j];
			}
		}
	}
	for(int o=0;o<2;o++) {
		for(int i = 1; i <= n; i++) {
			for(int j = 1; j <= n; j++) {
				sum[o][i][j] = sum[o][i][j - 1] + a[o][i][j];
			}
		}

		for(int i = 1; i <= n; i++) {
			for(int j = 1; j <= n; j++) {
				sum[o][i][j] += sum[o][i - 1][j];
			}
		}
	}

	memset(f,128,sizeof f);
	ll ans = f[0][0];
	f[0][0] = 0;
	for(int l = 0; l <= n; l++) {
		for(int r = l; r <= n; r++) {
			for(int nx = r + 1; nx <= n; nx++) {
				if (r == 0 && nx == 2) {
					int kk = r;
				}
				f[r][nx] = max(f[r][nx], f[l][r] + getsum(1, 1, r, r + 1, nx) + getsum(0, r + 1, nx, l + 1, nx));

			}
		}
	}
	for(int l = 1; l <= n; l++) ans = max(ans, f[l][n]);
	cout<<ss - ans<<endl;
}